summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-04-28 20:19:50 +0300
committerunknown <monty@mysql.com>2004-04-28 20:19:50 +0300
commitae629fff866dda4e0e3411b0614d0c1efdfb6362 (patch)
treee291189eeafdc3ec3d13555fa8bd4a082a08166f /libmysql
parent5605374b668068ef5ede826b3d04e2fe7ead4f9f (diff)
downloadmariadb-git-ae629fff866dda4e0e3411b0614d0c1efdfb6362.tar.gz
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
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index e63a583a0dd..4447ece308e 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -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);
}