Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PyMySQL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
PyMySQL
Commits
ab42f7bfa224
Commit
ab42f7bfa224
authored
14 years ago
by
Pete Hunt
Browse files
Options
Downloads
Patches
Plain Diff
fixed issue 43
parent
3e9c1af49194
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pymysql/connections.py
+7
-7
7 additions, 7 deletions
pymysql/connections.py
pymysql/converters.py
+2
-2
2 additions, 2 deletions
pymysql/converters.py
with
9 additions
and
9 deletions
pymysql/connections.py
+
7
−
7
View file @
ab42f7bf
...
...
@@ -537,8 +537,7 @@
def
close
(
self
):
'''
Send the quit message and close the socket
'''
if
self
.
socket
:
send_data
=
struct
.
pack
(
'
<i
'
,
1
)
+
int2byte
(
COM_QUIT
)
self
.
socket
.
send
(
send_data
)
self
.
socket
.
close
()
self
.
socket
=
None
...
...
@@ -541,9 +540,7 @@
send_data
=
struct
.
pack
(
'
<i
'
,
1
)
+
int2byte
(
COM_QUIT
)
self
.
socket
.
send
(
send_data
)
self
.
socket
.
close
()
self
.
socket
=
None
else
:
self
.
errorhandler
(
None
,
InterfaceError
,
"
(0,
''
)
"
)
def
autocommit
(
self
,
value
):
'''
Set whether or not to commit after every execute()
'''
...
...
@@ -692,6 +689,9 @@
def
_send_command
(
self
,
command
,
sql
):
#send_data = struct.pack('<i', len(sql) + 1) + command + sql
# could probably be more efficient, at least it's correct
if
not
self
.
socket
:
self
.
errorhandler
(
None
,
InterfaceError
,
"
(0,
''
)
"
)
if
isinstance
(
sql
,
unicode
):
sql
=
sql
.
encode
(
self
.
charset
)
...
...
This diff is collapsed.
Click to expand it.
pymysql/converters.py
+
2
−
2
View file @
ab42f7bf
...
...
@@ -338,8 +338,8 @@
decoders
[
FIELD_TYPE
.
DECIMAL
]
=
convert_decimal
decoders
[
FIELD_TYPE
.
NEWDECIMAL
]
=
convert_decimal
def
escape_decimal
(
obj
,
charset
):
return
unicode
(
obj
)
.
encode
(
charset
)
def
escape_decimal
(
obj
):
return
unicode
(
obj
)
encoders
[
Decimal
]
=
escape_decimal
except
ImportError
:
...
...
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