Commit 32d0b695 authored by monty@mysql.com's avatar monty@mysql.com

Allow one to send empty strings with mysql_stmt_send_long_data()

mysql_stmt_reset() now resets param->long_data_used
Abort if --defaults-file=path-name uses a non-existing file (Bug #3413)
Fixed problem with symlink test (bug in 4.1.2)
parent 9d8bb4bd
......@@ -2754,12 +2754,13 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
DBUG_RETURN(1);
}
/* Mark for execute that the result is already sent */
param->long_data_used= 1;
if (length)
if (length || param->long_data_used == 0)
{
MYSQL *mysql= stmt->mysql;
char *packet, extra_data[MYSQL_LONG_DATA_HEADER];
param->long_data_used= 1;
packet= extra_data;
int4store(packet, stmt->stmt_id); packet+=4;
int2store(packet, param_number); packet+=2;
......@@ -3805,6 +3806,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
{
char buff[MYSQL_STMT_HEADER];
MYSQL *mysql;
MYSQL_BIND *param, *param_end;
DBUG_ENTER("mysql_stmt_reset");
DBUG_ASSERT(stmt != 0);
......@@ -3820,6 +3822,13 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
mysql->net.sqlstate);
DBUG_RETURN(1);
}
/* Clear long_data_used for next call (as we do in mysql_stmt_execute() */
for (param= stmt->params, param_end= param + stmt->param_count;
param < param_end;
param++)
param->long_data_used= 0;
DBUG_RETURN(0);
}
......
......@@ -166,6 +166,12 @@ int load_defaults(const char *conf_file, const char **groups,
if ((error= search_default_file(&args, &alloc, "",
forced_default_file, "", &group)) < 0)
goto err;
if (error > 0)
{
fprintf(stderr, "Could not open required defaults file: %s\n",
forced_default_file);
goto err;
}
}
else if (dirname_length(conf_file))
{
......
......@@ -214,9 +214,13 @@ int rea_create_table(THD *thd, my_string file_name,
DBUG_ENTER("rea_create_table");
if (mysql_create_frm(thd, file_name, create_info,
create_fields, keys, key_info, NULL) ||
ha_create_table(file_name,create_info,0))
create_fields, keys, key_info, NULL))
DBUG_RETURN(1);
if (ha_create_table(file_name,create_info,0))
{
my_delete(file_name,MYF(0));
DBUG_RETURN(1);
}
DBUG_RETURN(0);
} /* rea_create_table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment