Skip to content

Commit 4202f61

Browse files
authored
Don't use mysql_real_escape_string_quote on MariaDB (#115)
1 parent 4d5848e commit 4202f61

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_mysql.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ _mysql_escape_string(
10641064
if (self && PyModule_Check((PyObject*)self))
10651065
self = NULL;
10661066
if (self && self->open) {
1067-
#if MYSQL_VERSION_ID >= 50707
1067+
#if MYSQL_VERSION_ID >= 50707 && !defined(MARIADB_BASE_VERSION)
10681068
len = mysql_real_escape_string_quote(&(self->connection), out, in, size, '\'');
10691069
#else
10701070
len = mysql_real_escape_string(&(self->connection), out, in, size);
@@ -1122,7 +1122,7 @@ _mysql_string_literal(
11221122
out = PyBytes_AS_STRING(str);
11231123
check_server_init(NULL);
11241124
if (self && self->open) {
1125-
#if MYSQL_VERSION_ID >= 50707
1125+
#if MYSQL_VERSION_ID >= 50707 && !defined(MARIADB_BASE_VERSION)
11261126
len = mysql_real_escape_string_quote(&(self->connection), out+1, in, size, '\'');
11271127
#else
11281128
len = mysql_real_escape_string(&(self->connection), out+1, in, size);

0 commit comments

Comments
 (0)