Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
erp5
Commits
6029cd4c
Commit
6029cd4c
authored
Nov 15, 2023
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZMySQLDA: support isolation_level argument in ZMySQLDA.db.query().
parent
07e91aa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+5
-3
No files found.
product/ZMySQLDA/db.py
View file @
6029cd4c
...
...
@@ -437,7 +437,7 @@ class DB(TM):
else
:
raise
def
query
(
self
,
query_string
,
max_rows
=
1000
):
def
query
(
self
,
query_string
,
max_rows
=
1000
,
isolation_level
=
None
):
"""Execute 'query_string' and return at most 'max_rows'."""
desc
=
None
if
isinstance
(
query_string
,
six
.
text_type
):
...
...
@@ -448,7 +448,9 @@ class DB(TM):
if
query_string
[
-
1
:]
==
b';'
:
query_string
=
query_string
[:
-
1
]
if
self
.
_use_TM
and
not
self
.
_registered
:
if
self
.
_isolation_level
:
if
isolation_level
:
self
.
_current_isolation_level
=
isolation_level
elif
self
.
_isolation_level
:
self
.
_current_isolation_level
=
self
.
_isolation_level
else
:
for
qs
in
query_string
.
split
(
b'
\
0
'
):
...
...
@@ -677,7 +679,7 @@ class DeferredDB(DB):
assert self._use_TM
self._sql_string_list = []
def query(self, query_string, max_rows=1000):
def query(self, query_string, max_rows=1000
, isolation_level=None
):
self._register()
if isinstance(query_string, six.text_type):
query_string = query_string.encode('utf-8')
...
...
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