Insert works differently: CONNECT make an INSERT statement (prepared when accepted by the driver) and fills the values before executing it.
For UPDATE and DELETE, the original query is retrieved from MariaDB and edited to change the table name. The issue is that the query retrieved using the thd_query_string funtion is not identical to the original one. For instance, when executing:
update mynumb set v = 'Fred\'s' where n = 1;
|
update mynumb set v = 'size is 28"' where n = 2;
|
The thd_query_string funtion returns:
update mynumb set v = 'Fred\\'s' where n = 1;
|
update mynumb set v = 'size is 28\"' where n = 2;
|
I think this is a MariaDB problem (bug?), not a CONNECT one.
Note that when connected via JDBC to a MySQL or MariaDB server, the update is done correctly, probably because the parser knows how to eliminate the spurious backslash.
Meanwhile a turnaround seems to replace escaping by doubling the character:
update mynumb set v = 'Fred''s' where n = 1;
|
update mynumb set v = "size is 28""" where n = 2;
|
Providing the remote server accepts it.
Insert works differently: CONNECT make an INSERT statement (prepared when accepted by the driver) and fills the values before executing it.
For UPDATE and DELETE, the original query is retrieved from MariaDB and edited to change the table name. The issue is that the query retrieved using the thd_query_string funtion is not identical to the original one. For instance, when executing:
update mynumb set v = 'Fred\'s' where n = 1;
update mynumb set v = 'size is 28"' where n = 2;
The thd_query_string funtion returns:
update mynumb set v = 'Fred\\'s' where n = 1;
update mynumb set v = 'size is 28\"' where n = 2;
I think this is a MariaDB problem (bug?), not a CONNECT one.
Note that when connected via JDBC to a MySQL or MariaDB server, the update is done correctly, probably because the parser knows how to eliminate the spurious backslash.
Meanwhile a turnaround seems to replace escaping by doubling the character:
update mynumb set v = 'Fred''s' where n = 1;
update mynumb set v = "size is 28""" where n = 2;
Providing the remote server accepts it.