Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
erp5
Commits
b721632e
Commit
b721632e
authored
Apr 27, 2022
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CMFActivity: Prevent generation of meaningless LIMIT on SQL lock operations.
parent
593b6cf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
product/CMFActivity/Activity/SQLBase.py
product/CMFActivity/Activity/SQLBase.py
+8
-2
No files found.
product/CMFActivity/Activity/SQLBase.py
View file @
b721632e
...
@@ -100,14 +100,20 @@ def SQLLock(db, lock_name, timeout):
...
@@ -100,14 +100,20 @@ def SQLLock(db, lock_name, timeout):
"""
"""
lock_name
=
db
.
string_literal
(
lock_name
)
lock_name
=
db
.
string_literal
(
lock_name
)
query
=
db
.
query
query
=
db
.
query
(
_
,
((
acquired
,
),
))
=
query
(
'SELECT GET_LOCK(%s, %f)'
%
(
lock_name
,
timeout
))
(
_
,
((
acquired
,
),
))
=
query
(
'SELECT GET_LOCK(%s, %f)'
%
(
lock_name
,
timeout
),
max_rows
=
0
,
)
if
acquired
is
None
:
if
acquired
is
None
:
raise
ValueError
(
'Error acquiring lock'
)
raise
ValueError
(
'Error acquiring lock'
)
try
:
try
:
yield
acquired
yield
acquired
finally
:
finally
:
if
acquired
:
if
acquired
:
query
(
'SELECT RELEASE_LOCK(%s)'
%
(
lock_name
,
))
query
(
'SELECT RELEASE_LOCK(%s)'
%
(
lock_name
,
),
max_rows
=
0
,
)
# sqltest_dict ({'condition_name': <render_function>}) defines how to render
# sqltest_dict ({'condition_name': <render_function>}) defines how to render
# condition statements in the SQL query used by SQLBase.getMessageList
# condition statements in the SQL query used by SQLBase.getMessageList
def
sqltest_dict
():
def
sqltest_dict
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment