1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-08 14:02:17 +03:00

[MDEV-30366] Bulk unitary result flag client implementation part.

With MDEV-30366, server now permit to send a result-set containing generated id and Affected rows for each bulk operation. This feature can be enabled with option MARIADB_OPT_BULK_UNIT_RESULTS when server supports it.
This commit is contained in:
rusher
2024-03-06 16:03:55 +01:00
parent 4a74f8784d
commit abce07da2a
8 changed files with 385 additions and 8 deletions

View File

@@ -693,6 +693,7 @@ struct st_default_options mariadb_defaults[] =
{{MYSQL_OPT_SSL_ENFORCE}, MARIADB_OPTION_BOOL, "ssl-enforce"},
{{MARIADB_OPT_RESTRICTED_AUTH}, MARIADB_OPTION_STR, "restricted-auth"},
{{.option_func=parse_connection_string}, MARIADB_OPTION_FUNC, "connection"},
{{MARIADB_OPT_BULK_UNIT_RESULTS}, MARIADB_OPTION_BOOL, "bulk-unit-results"},
/* Aliases */
{{MARIADB_OPT_SCHEMA}, MARIADB_OPTION_STR, "db"},
{{MARIADB_OPT_UNIXSOCKET}, MARIADB_OPTION_STR, "unix_socket"},
@@ -3830,6 +3831,9 @@ mysql_optionsv(MYSQL *mysql,enum mysql_option option, ...)
}
}
break;
case MARIADB_OPT_BULK_UNIT_RESULTS:
OPT_SET_EXTENDED_VALUE_INT(&mysql->options, bulk_unit_results, *(my_bool *)arg1);
break;
default:
va_end(ap);
SET_CLIENT_ERROR(mysql, CR_NOT_IMPLEMENTED, SQLSTATE_UNKNOWN, 0);
@@ -4052,6 +4056,9 @@ mysql_get_optionv(MYSQL *mysql, enum mysql_option option, void *arg, ...)
case MARIADB_OPT_SKIP_READ_RESPONSE:
*((my_bool*)arg)= mysql->options.extension ? mysql->options.extension->skip_read_response : 0;
break;
case MARIADB_OPT_BULK_UNIT_RESULTS:
*((my_bool *)arg)= mysql->options.extension ? mysql->options.extension->bulk_unit_results : 0;
break;
default:
va_end(ap);
SET_CLIENT_ERROR(mysql, CR_NOT_IMPLEMENTED, SQLSTATE_UNKNOWN, 0);