mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-04 08:04:45 +00:00
Implementation of CONPY-29: Support format and pyformat paramstyle
While the default paramstyle is still 'qmark', MariaDB Connector/Python now also supports the paramstyles 'format' and 'pyformat'. The paramstyles can't be mixed.
This commit is contained in:
@ -70,6 +70,14 @@ enum enum_tpc_state
|
||||
TPC_STATE_PREPARE
|
||||
};
|
||||
|
||||
enum enum_paramstyle
|
||||
{
|
||||
NONE=0,
|
||||
QMARK,
|
||||
FORMAT,
|
||||
PYFORMAT
|
||||
};
|
||||
|
||||
typedef struct st_lex_str {
|
||||
char *str;
|
||||
size_t length;
|
||||
@ -85,6 +93,7 @@ typedef struct st_parser {
|
||||
uint32_t param_count;
|
||||
uint32_t key_count;
|
||||
char* value_ofs;
|
||||
enum enum_paramstyle paramstyle;
|
||||
MrdbString *keys;
|
||||
} MrdbParser;
|
||||
|
||||
@ -259,7 +268,7 @@ uint8_t mariadb_param_update(void *data, MYSQL_BIND *bind, uint32_t row_nr);
|
||||
/* parser prototypes */
|
||||
MrdbParser *MrdbParser_init(const char *statement, size_t length);
|
||||
void MrdbParser_end(MrdbParser *p);
|
||||
void MrdbParser_parse(MrdbParser *p, uint8_t is_batch);
|
||||
uint8_t MrdbParser_parse(MrdbParser *p, uint8_t is_batch, char *errmsg, size_t errmsg_len);
|
||||
|
||||
|
||||
/* Global defines */
|
||||
|
Reference in New Issue
Block a user