Commit ae629fff authored by unknown's avatar unknown

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)


libmysql/libmysql.c:
  Allow one to send empty strings with mysql_stmt_send_long_data()
  mysql_stmt_reset() now resets param->long_data_used
mysys/default.c:
  Abort if --defaults-file=path-name uses a non-existing file (Bug #3413)
sql/unireg.cc:
  Fixed problem with symlink test:  .frm table was not properly deleted if handler create failed
parent 5605374b
...@@ -2754,12 +2754,13 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number, ...@@ -2754,12 +2754,13 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
DBUG_RETURN(1); DBUG_RETURN(1);
} }
/* Mark for execute that the result is already sent */ /* Mark for execute that the result is already sent */
param->long_data_used= 1; if (length || param->long_data_used == 0)
if (length)
{ {
MYSQL *mysql= stmt->mysql; MYSQL *mysql= stmt->mysql;
char *packet, extra_data[MYSQL_LONG_DATA_HEADER]; char *packet, extra_data[MYSQL_LONG_DATA_HEADER];
param->long_data_used= 1;
packet= extra_data; packet= extra_data;
int4store(packet, stmt->stmt_id); packet+=4; int4store(packet, stmt->stmt_id); packet+=4;
int2store(packet, param_number); packet+=2; int2store(packet, param_number); packet+=2;
...@@ -3805,6 +3806,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) ...@@ -3805,6 +3806,7 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
{ {
char buff[MYSQL_STMT_HEADER]; char buff[MYSQL_STMT_HEADER];
MYSQL *mysql; MYSQL *mysql;
MYSQL_BIND *param, *param_end;
DBUG_ENTER("mysql_stmt_reset"); DBUG_ENTER("mysql_stmt_reset");
DBUG_ASSERT(stmt != 0); DBUG_ASSERT(stmt != 0);
...@@ -3820,6 +3822,13 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt) ...@@ -3820,6 +3822,13 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
mysql->net.sqlstate); mysql->net.sqlstate);
DBUG_RETURN(1); 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); DBUG_RETURN(0);
} }
......
...@@ -166,6 +166,12 @@ int load_defaults(const char *conf_file, const char **groups, ...@@ -166,6 +166,12 @@ int load_defaults(const char *conf_file, const char **groups,
if ((error= search_default_file(&args, &alloc, "", if ((error= search_default_file(&args, &alloc, "",
forced_default_file, "", &group)) < 0) forced_default_file, "", &group)) < 0)
goto err; 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)) else if (dirname_length(conf_file))
{ {
......
...@@ -214,9 +214,13 @@ int rea_create_table(THD *thd, my_string file_name, ...@@ -214,9 +214,13 @@ int rea_create_table(THD *thd, my_string file_name,
DBUG_ENTER("rea_create_table"); DBUG_ENTER("rea_create_table");
if (mysql_create_frm(thd, file_name, create_info, if (mysql_create_frm(thd, file_name, create_info,
create_fields, keys, key_info, NULL) || create_fields, keys, key_info, NULL))
ha_create_table(file_name,create_info,0))
DBUG_RETURN(1); DBUG_RETURN(1);
if (ha_create_table(file_name,create_info,0))
{
my_delete(file_name,MYF(0));
DBUG_RETURN(1);
}
DBUG_RETURN(0); DBUG_RETURN(0);
} /* rea_create_table */ } /* 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