mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge from 5.1 to 5.5
This commit is contained in:
commit
3785ca65f5
3 changed files with 24 additions and 7 deletions
|
@ -875,6 +875,14 @@ static bool insert_params_with_log(Prepared_statement *stmt, uchar *null_array,
|
||||||
param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
|
param->set_param_func(param, &read_pos, (uint) (data_end - read_pos));
|
||||||
if (param->state == Item_param::NO_VALUE)
|
if (param->state == Item_param::NO_VALUE)
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
|
if (param->limit_clause_param && param->item_type != Item::INT_ITEM)
|
||||||
|
{
|
||||||
|
param->set_int(param->val_int(), MY_INT64_NUM_DECIMAL_DIGITS);
|
||||||
|
param->item_type= Item::INT_ITEM;
|
||||||
|
if (!param->unsigned_flag && param->value.integer < 0)
|
||||||
|
DBUG_RETURN(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -48,6 +48,7 @@ static unsigned int opt_count= 0;
|
||||||
static unsigned int iter_count= 0;
|
static unsigned int iter_count= 0;
|
||||||
static my_bool have_innodb= FALSE;
|
static my_bool have_innodb= FALSE;
|
||||||
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
|
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
|
||||||
|
static unsigned int opt_drop_db= 1;
|
||||||
|
|
||||||
static const char *opt_basedir= "./";
|
static const char *opt_basedir= "./";
|
||||||
static const char *opt_vardir= "mysql-test/var";
|
static const char *opt_vardir= "mysql-test/var";
|
||||||
|
@ -96,7 +97,7 @@ DBUG_PRINT("test", ("name: %s", str)); \
|
||||||
|
|
||||||
static void print_error(const char *msg);
|
static void print_error(const char *msg);
|
||||||
static void print_st_error(MYSQL_STMT *stmt, const char *msg);
|
static void print_st_error(MYSQL_STMT *stmt, const char *msg);
|
||||||
static void client_disconnect(MYSQL* mysql, my_bool drop_db);
|
static void client_disconnect(MYSQL* mysql);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -370,7 +371,7 @@ static MYSQL* client_connect(ulong flag, uint protocol, my_bool auto_reconnect)
|
||||||
|
|
||||||
/* Close the connection */
|
/* Close the connection */
|
||||||
|
|
||||||
static void client_disconnect(MYSQL* mysql, my_bool drop_db)
|
static void client_disconnect(MYSQL* mysql)
|
||||||
{
|
{
|
||||||
static char query[MAX_TEST_QUERY_LENGTH];
|
static char query[MAX_TEST_QUERY_LENGTH];
|
||||||
|
|
||||||
|
@ -378,7 +379,7 @@ static void client_disconnect(MYSQL* mysql, my_bool drop_db)
|
||||||
|
|
||||||
if (mysql)
|
if (mysql)
|
||||||
{
|
{
|
||||||
if (drop_db)
|
if (opt_drop_db)
|
||||||
{
|
{
|
||||||
if (!opt_silent)
|
if (!opt_silent)
|
||||||
fprintf(stdout, "\n dropping the test database '%s' ...", current_db);
|
fprintf(stdout, "\n dropping the test database '%s' ...", current_db);
|
||||||
|
@ -1162,6 +1163,8 @@ static struct my_option client_test_long_options[] =
|
||||||
&opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
|
&opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
|
||||||
{"database", 'D', "Database to use", &opt_db, &opt_db,
|
{"database", 'D', "Database to use", &opt_db, &opt_db,
|
||||||
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
{"do-not-drop-database", 'd', "Do not drop database while disconnecting",
|
||||||
|
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"debug", '#', "Output debug log", &default_dbug_option,
|
{"debug", '#', "Output debug log", &default_dbug_option,
|
||||||
&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
|
{"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
|
||||||
|
@ -1265,6 +1268,9 @@ char *argument)
|
||||||
else
|
else
|
||||||
opt_silent++;
|
opt_silent++;
|
||||||
break;
|
break;
|
||||||
|
case 'd':
|
||||||
|
opt_drop_db= 0;
|
||||||
|
break;
|
||||||
case 'A':
|
case 'A':
|
||||||
/*
|
/*
|
||||||
When the embedded server is being tested, the test suite needs to be
|
When the embedded server is being tested, the test suite needs to be
|
||||||
|
@ -1389,7 +1395,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv);
|
fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv);
|
||||||
fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n",
|
fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n",
|
||||||
my_progname);
|
my_progname);
|
||||||
client_disconnect(mysql, 1);
|
client_disconnect(mysql);
|
||||||
free_defaults(defaults_argv);
|
free_defaults(defaults_argv);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
@ -1402,7 +1408,7 @@ int main(int argc, char **argv)
|
||||||
/* End of tests */
|
/* End of tests */
|
||||||
}
|
}
|
||||||
|
|
||||||
client_disconnect(mysql, 1); /* disconnect from server */
|
client_disconnect(mysql); /* disconnect from server */
|
||||||
|
|
||||||
free_defaults(defaults_argv);
|
free_defaults(defaults_argv);
|
||||||
print_test_output();
|
print_test_output();
|
||||||
|
|
|
@ -17609,6 +17609,7 @@ static void test_bug43560(void)
|
||||||
const char* values[] = {"eins", "zwei", "drei", "viele", NULL};
|
const char* values[] = {"eins", "zwei", "drei", "viele", NULL};
|
||||||
const char insert_str[] = "INSERT INTO t1 (c2) VALUES (?)";
|
const char insert_str[] = "INSERT INTO t1 (c2) VALUES (?)";
|
||||||
unsigned long length;
|
unsigned long length;
|
||||||
|
const unsigned int drop_db= opt_drop_db;
|
||||||
|
|
||||||
DBUG_ENTER("test_bug43560");
|
DBUG_ENTER("test_bug43560");
|
||||||
myheader("test_bug43560");
|
myheader("test_bug43560");
|
||||||
|
@ -17674,9 +17675,11 @@ static void test_bug43560(void)
|
||||||
rc= mysql_stmt_execute(stmt);
|
rc= mysql_stmt_execute(stmt);
|
||||||
DIE_UNLESS(rc && mysql_stmt_errno(stmt) == CR_SERVER_LOST);
|
DIE_UNLESS(rc && mysql_stmt_errno(stmt) == CR_SERVER_LOST);
|
||||||
|
|
||||||
client_disconnect(conn, 0);
|
opt_drop_db= 0;
|
||||||
|
client_disconnect(conn);
|
||||||
rc= mysql_query(mysql, "DROP TABLE t1");
|
rc= mysql_query(mysql, "DROP TABLE t1");
|
||||||
myquery(rc);
|
myquery(rc);
|
||||||
|
opt_drop_db= drop_db;
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue