Commit Graph

63 Commits

Author SHA1 Message Date
2bd40ca1de Test fixes 2021-07-18 18:16:38 +02:00
8ee02ac7e3 Cursor fixes for execute, implemented execute_direct 2021-07-14 22:14:52 +02:00
84df56ce40 connection and cursor class are now written in
native python
2021-07-12 09:46:05 +02:00
27730cd018 Moved more methods and propertys from C to Python code 2021-03-21 22:44:42 +01:00
1299be5031 fixed typo 2021-01-18 06:41:15 +01:00
1f084d112f disable pooling until tests are ready 2021-01-18 06:39:05 +01:00
b5936a9d02 Added new class Pool 2021-01-18 06:37:09 +01:00
aa65cc853a Exchanged C written connection pool class by native python class. 2021-01-18 06:11:03 +01:00
2ce8f2cf2f Added missing dbapi20.py 2020-12-02 10:41:29 +01:00
feb990db4e Moved DBAPI 2.0 Date/Time/Timestamp constructors from C code to Python module dpapi20.py 2020-12-01 20:59:27 +01:00
a2b3e98104 Replaced Mrdb_Fieldinfo by python fieldinfo class 2020-12-01 08:28:01 +01:00
7df428ecf8 Moved Objects from c to python code
Indicator, BINARY, NUMBER, STRING and DATE objects were moved
to python code
2020-11-30 16:49:16 +01:00
e8d7854fef codespell typo fixes 2020-11-25 13:44:18 +01:00
5718305c3b Windows build fix 2020-11-24 15:54:15 +01:00
a1c709b0e8 Fix for CONPY-133:
Extended parser for supporting MariaDB comment syntax
(https://mariadb.com/kb/en/comment-syntax/)
2020-11-24 14:00:56 +01:00
6a832099b1 Fixed base class for exceptions 2020-11-24 14:00:15 +01:00
0f0468a085 Fix for CONC-132: Fix leak in connection pool
When closing a connection pool the allocated buffer for pool_name
was not freed in a proper way.
2020-11-23 15:15:13 +01:00
fab2a6d810 Fixed bug in pooling:
Due to missing reference count incrementation the default configuration
was removed/overwritten.
2020-11-22 20:38:26 +01:00
26ca93492f Test fixes for testing against MySQL server 2020-11-18 16:42:35 +01:00
312ba15173 Follow up of fix for CONC-130:
Workaround for #21066 (https://bugs.python.org/issue20066)
2020-11-16 14:58:59 +01:00
acf9f9190e Fix for CONPY-127: Let connector accept None values
Fix implementation of connection method: String values
now additionally except None values which will be
internally transformed to NULL.
2020-11-16 11:15:22 +01:00
a47d3e5d76 Implementation of CONPY-129:
Added connection attribute server_version_info and (for compatibiliry)
get_server_version() method.
Both return a tuple, describing the version number of connected server
in following format: (MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION)
2020-11-16 10:03:05 +01:00
4a5d02a1b1 Fix for CONPY-130: DeprecationWarning: builtin type Row has no _module_ attribute
Changed sequence description from Row to mariadb.Row.

This patch also includes a followup fix for CONP-131:

PyStrustSequenceNew will be used only for Python versions > 3.6
2020-11-16 07:33:53 +01:00
f6be6ba512 Fix for CONPY-131:
Instead of using PyStructSequence_New (broken in Python3.6) use a
static struct which will be initialized voa PyStructSequence_Init()
call.
2020-11-16 07:07:50 +01:00
37864dd831 Fix for CONPY-126
Connection attributes in PyMember definition will be accessed as
string constants instead of Python Object, so the object will be
created only if the member will be accessed in python code and it's
reference count doesn't need to be decrement when the connection
class will be deallocated.
2020-11-01 09:14:11 +01:00
3b2edf5b35 Fix for CONPY-115:
Replaced the obsolete ULONG_LONG_MAX definition by
ULLONG_MAX.
2020-10-19 08:11:32 +02:00
d30042b01a Fixed build error
According to the documentation (but also setup.py) the minimum
required version of MariaDB Connector/C is 3.1.5. Since extended
field_types were added in 3.1,8, we need to check the version
of MariaDB Connector/C.
2020-10-13 08:44:33 +02:00
020017ee33 Fix for CONPY123: Free pending result sets when closing cursor
When using text protocol pending result sets weren't properly freed,
so executing another command on the same connection resulted in an error
"commands out of sync".
2020-10-12 09:05:49 +02:00
21c9afc13f Removed reference increment in cursor.description 2020-10-04 12:34:41 +02:00
8944cb889a Error handling fixes:
Instead of OperationalException and IntegrityException will be raised
for the following eror types:
ER_BAD_NULL_ERROR, ER_DATA_OUT_OF_RANGE, ER_CONSTRAINT_FAILED, ER_DUP_CONSTRAINT_NAME
2020-10-04 11:35:40 +02:00
846c0d0fdb Fix for CONPY-119: Fixed memory leak
When creating a cursor with result set type named_tuple
or dictionary, references were not decremented correctly.

For named tuples we don't use a static variable anymore, instead
of it will be created by PyStructSequence_NewType.
2020-10-03 16:41:29 +02:00
cbd51decc6 When converting parameters also check subtype of a Python Object 2020-10-02 12:54:21 +02:00
bce98d74cd Fix for CONPY-118: Leak when using text protocol
Removed statement allocation from the cursor init function and
allocate it only in executemany and execute if paraemters were
supplied.
2020-10-02 12:52:09 +02:00
08673bbdf4 Small "workaround" for MDEV-23481:
Don't set the unsigned flag if the value will fit into signed integer.
2020-09-29 14:14:02 +02:00
8ff03334c2 Fixed conversion of Integer parameters:
If bits of PyLong are > 32 we will always use MYSQL_TYPE_LONGLONG.
2020-09-29 13:46:13 +02:00
3f95456824 CONPY-117: Added converter support
The connect() method now accepts an addtional parameter
converter which points to a dictionary, containing one or more conversions.
A conversion must be specified in the form {FIELD_TYOE : conversion_function}
2020-09-29 13:21:13 +02:00
5d4a8d5d62 Fix for CONPY-116: Wrong type reported for SQL type JSON
Beginning of MariaDB 10.5 metadata for JSON columns is stored
in extended field information, and the reported type is MYSQL_TYPE_BLOB.
We now check extended field information to return correct type and for
fetching values in correct format.
2020-09-29 11:43:47 +02:00
6ab09b21f1 Fixed parser bug 2020-09-22 07:01:07 +02:00
23678b31ca removed redundant callproc method entry 2020-09-19 15:37:54 +02:00
6fcb9a5642 more compiler warning fixes 2020-09-19 15:32:50 +02:00
709ac83799 Fixed compiler warnings 2020-09-19 14:05:53 +02:00
51810b79f2 Added constants.FIELD_TYPE 2020-09-15 12:34:37 +02:00
e807101db2 Fix for CONC-110
Fixed a small typo (b instead of p) which caused a memory overrun
when parsing dsn keywords for connection and using keyword 'ssl'.
2020-09-04 13:31:17 +02:00
bd560c2bb9 Fix for CONPY-108 (memory leak):
- initialize datetime API only once per object file
- don't reparse same statement
2020-08-29 12:20:52 +02:00
3c264b2d2a Fix memory leak in fetchmany (same bug as CONPY-99) 2020-08-20 18:12:58 +02:00
837a36ea15 Fix rowcount calculation for emulated bulk operations 2020-08-16 15:10:26 +02:00
74933240ba Fix for CONPY-99:
Decrement reference to row after adding it to lit to prevent
memory leakage
2020-08-16 09:40:10 +02:00
92eaf17fd5 Follow up fix for CONPY-107:
Support also insert/update/delete with PyDateTime_Delta objects
2020-08-16 07:30:58 +02:00
e078e26a18 Fix for CONPY-107:
Since Python is not able to handle negative values, a column defined as TIME will
now be converted to datetime.timedelta instead of datetime.time.
2020-08-15 19:00:40 +02:00
021c4e6aaa Allow different decimal types in executemany():
It is now possible to use different decimal types for the same column
in cursors executemany() method.
2020-08-14 19:55:41 +02:00