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
This commit is contained in:
Georg Richter
2022-06-08 13:43:20 +02:00
parent ad4937dc96
commit 5420fe39d9
6 changed files with 128 additions and 175 deletions

View File

@ -1193,7 +1193,8 @@ mariadb_check_execute_parameters(MrdbCursor *self,
goto error;
}
if (!(self->value= PyMem_RawCalloc(self->parseinfo.paramcount, sizeof(MrdbParamValue))))
if (!self->value &&
!(self->value= PyMem_RawCalloc(self->parseinfo.paramcount, sizeof(MrdbParamValue))))
{
mariadb_throw_exception(NULL, Mariadb_InterfaceError, 0,
"Not enough memory (tried to allocated %lld bytes)",