Commit Graph

19 Commits

Author SHA1 Message Date
312ba15173 Follow up of fix for CONC-130:
Workaround for #21066 (https://bugs.python.org/issue20066)
2020-11-16 14:58:59 +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
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
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
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
23678b31ca removed redundant callproc method entry 2020-09-19 15:37:54 +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
afea681910 Fix for CONPY-105: Change behavior of cursor->rowcount and cursor->lastrowid
rowcount:
In case of an error, or if statement wasn't executed rowcount should be -1 (see PEP-249)

    For DML statements the number of affected rows returned in OK packet by server:
        > 0 for DML statements which modify or insert, e.g. ALTER TABLE or CREATE TABLE .. SELECT FROM
        otherwise 0
    For DQL statement
        if field_count > 0: number of rows returned
        otherwise affected rows returned in OK packet by server.

lastrowid:

    if server returns no value (0) for last_insert_id, lastrowid should be None.
    if last_insert_id is > 0, return it's value
2020-08-14 16:44:13 +02:00
588bc01cc0 Implementation for CONPY-100:
Add option binary for cursor. When set to true cursor will always try
to use the client/server binary protocol, even when no parameter were
passed to execute.
2020-08-12 16:05:29 +02:00
03f283a2ff Fix for CONPY-101: Negative refcount when executing callproc() method
Removed the reference decrement in callproc function.
2020-08-12 07:31:25 +02:00
01053e0d4a Fix for CONPY-93:
When releasing the GIL we need to unblock/block in callback functions (mariadb_codecs.c)
2020-08-05 18:54:19 +02:00
29b05e3b09 Various fixes and changes for SQLAlchemy support:
- added a thin python wrapper around mariadb module
- added constansts under mariadb.constants (CLIENT, CURSOR, INDICATOR)
- bench and test are now in testing subdirectory
- updated documentation
2020-07-24 12:13:31 +02:00