Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
memcache-3394817
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
memcache-3394817
Commits
f240aaac
Commit
f240aaac
authored
17 years ago
by
Robert Douglass
Browse files
Options
Downloads
Patches
Plain Diff
#154287
by chx: no table locking
parent
1ae1086a
No related branches found
Branches containing commit
Tags
5.x-1.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
memcache.db.inc
+5
-6
5 additions, 6 deletions
memcache.db.inc
with
5 additions
and
6 deletions
memcache.db.inc
+
5
−
6
View file @
f240aaac
...
...
@@ -131,12 +131,11 @@ function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $he
$serialized
=
1
;
}
// Save to the database
db_lock_table
(
$table
);
db_query
(
"UPDATE
{
$table
}
SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'"
,
$data
,
time
(),
$expire
,
$headers
,
$serialized
,
$cid
);
if
(
!
db_affected_rows
())
{
@
db_query
(
"INSERT INTO
{
$table
}
(cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)"
,
$cid
,
$data
,
time
(),
$expire
,
$headers
,
$serialized
);
}
db_unlock_tables
();
db_query
(
"
INSERT INTO
{
$table
}
(data, created, expire, headers, serialized, cid) VALUES (%b, %d, %d, '%s', %d, '%s') ON DUPLICATE KEY
UPDATE data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'"
,
$data
,
time
(),
$expire
,
$headers
,
$serialized
,
$cid
,
$data
,
time
(),
$expire
,
$headers
,
$serialized
,
$cid
);
}
// Save to memcache
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment