Commit Graph

30 Commits

Author SHA1 Message Date
e7441f1e59 Performance optiomizations:
- Result sets
Convert named_tuple and dictinuary result sets directly from netbuffer,
instead to fetch them in tuples and convert it afterwards

- fetch rows()
Use MrdbCursor_fetchrows() c function for fetchmany/fetchall.
2022-10-09 11:15:46 +02:00
afbd4e35f8 fetchall optimzation:
instead to call fetchone() n times, we retrieve everything in
c function fetchall().
2022-10-03 10:39:40 +02:00
c3fe1a954e Fix for CONPY-221:
Removed __del__ method from cursors.py to prevent
raisiing if cursor was already properly closed via close()
method.
2022-08-27 07:25:09 +02:00
336bf34119 is_closed was renamed to _closed. 2022-08-13 10:25:11 +02:00
71614ab159 Merge branch '1.1-status' into 1.1 2022-08-09 16:09:22 +02:00
cdd42743cc Coding style fixes (PEP8)
Fixed various coding style stuff detected by flake8.
Added .pre-commit-config.yaml:
With command pre_commit install a hook for flake8 will be
installed.
2022-08-07 16:47:26 +02:00
a9ad1fcaee First implementation for status callback 2022-08-05 14:41:43 +02:00
205b9c2768 CONPY-218: Allow None as data parameter
Allow None as data parameter for cursors execute()
method.
Kudos to  Luciano Barcaro for providing a fix.
2022-07-21 05:46:53 +02:00
c30b597ba9 Fix for CONPY-213
Additionally to the fix for CONPY-214 (which fixed the iterator), we
need to check that converter will not be called with EOF (None).
2022-07-07 13:42:34 +02:00
687ba165cc Documentation fix:
Added note, that executemany() may return a result set
in case a RETURNING clause was specified.
2022-07-07 07:37:29 +02:00
275aaf3ee1 Fix for CONPY-214:
Replace cursor iterator by native python __iter__() method.
2022-07-06 22:57:58 +02:00
d61b805a4b Added CAPABILITY constants
Since CLIENT constants can be used to determine both server
and client capabilities we use now CAPABILITY constants
instead.

CLIENT constants were marked as deprecated in documentation
and will be removed in 2.0 release
2022-07-04 14:45:25 +02:00
09e5cad2c0 Fix for CONPY-212
The default settiing for buffered in cursors.execute() method has
to be None:
- if not specified, it will use cursor defaults
- if specified, the default behavior of cursor will be changed
2022-06-29 15:09:20 +02:00
ba56c73a34 CONPY-209:
When executing cursor in text protocol, the substitution of
parameters with mb chars didn't set the correct length.
2022-06-29 12:29:38 +02:00
5420fe39d9 Various fixes:
- removed utf8 part of parser, instead we use python binary
  object for parameter substituton (text mode)
- removed memory leaks
- fixed crash when reusing cursor with different number of
  placeholders
2022-06-08 13:43:20 +02:00
30c8f33b08 CONPY-205: Inconsistent exceptions
- All parameter exceptions are now ProgrammingErrors
- A dictionary now might contain more keys than
  placeholders in statement
- Fixed unhandled exception when using dictionary as parameter
2022-05-25 18:47:03 +02:00
7394d84f5e Don't clear rowcount after bulk
Since bulk operations using returning will return a result set,
we need to clear rowcount before performing bulk operation.
2022-05-21 10:02:18 +02:00
f93370a275 Cursor: Set buffered to True if no args were specified 2022-05-21 07:59:18 +02:00
1aa2bbef08 - Documentation
- docstring fixes
- removed doc and docs subdirectory, since documentation is in docs
  branch
2022-04-11 08:03:20 +02:00
55ce15a1aa Minor documentation fixes 2022-04-03 07:03:32 +02:00
811cc1c5f7 Check if object was closed:
When accessing methods or properties of connection and cursor objects
we now check if the object or parent object was closed and raise an
exception.
2022-01-16 20:59:58 +01:00
aaba6e2e11 Fix for CONPY-187:
For detecting server bulk capabilities extended server capabitilies
(instead of standard capabilities) have to be checked.

Kudos to Diego Dupin
2021-12-19 19:52:14 +01:00
3184707494 Fix for CONPY-168
Force use of binary protocol if binary parameters
were provided.
2021-10-03 06:50:00 +02:00
cfe3eee3b4 Fix for CONPY-167:
If executemany() is executed directly after execute() with the same
statement it needs to be reprepared.
2021-09-25 12:50:12 +02:00
aa6edc38cb Updated documentation 2021-08-21 18:09:48 +02:00
d3d1cfc482 Fixed rowcount for executemany() when connected
to a MySQL database server.
2021-08-16 09:28:32 +02:00
879744926b Raise exception if number of parameter doesn't match. 2021-08-05 09:57:09 +02:00
9ac0551ed1 Default mode for cursor changed:
Due to several incompatibilites (but also MDEV-23768, where errors
can't be triggered in unbuffered) we decided to switch the default
mode for cursor class for buffered from False to True.
2021-08-05 08:32:20 +02:00
8cd33d55c1 Fixed memory leak in parser 2021-08-03 11:31:31 +02:00
47ca11d921 Documentation update 2021-08-01 10:31:10 +02:00