Commit 14810ff1 authored by unknown's avatar unknown

Changed mysql-test to print warnings for not existing table to DROP TABLE

Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names.
changed store_warning() -> push_warning_print()



BitKeeper/deleted/.del-rpl000016-slave.opt~ef76f85ddcc13b87:
  Delete: mysql-test/t/rpl000016-slave.opt
BitKeeper/deleted/.del-sel000001.test~9567c1646058cc:
  Delete: mysql-test/t/sel000001.test
BitKeeper/deleted/.del-sel000002.test~9f500639572e18e1:
  Delete: mysql-test/t/sel000002.test
BitKeeper/deleted/.del-sel000003.test~63a5512d18cd20a2:
  Delete: mysql-test/t/sel000003.test
BitKeeper/deleted/.del-sel000001.result~383913ae4505ec86:
  Delete: mysql-test/r/sel000001.result
BitKeeper/deleted/.del-sel000002.result~d1787e6fd5dbc1cc:
  Delete: mysql-test/r/sel000002.result
BitKeeper/deleted/.del-sel000003.result~d7b657b1e3a286a7:
  Delete: mysql-test/r/sel000003.result
BitKeeper/deleted/.del-sel000031.result~d49aeac63ad7db4d:
  Delete: mysql-test/r/sel000031.result
BitKeeper/deleted/.del-sel000031.test~50a19a8e204e99bc:
  Delete: mysql-test/t/sel000031.test
BitKeeper/deleted/.del-sel000032.result~6cb30e23cbca9fb0:
  Delete: mysql-test/r/sel000032.result
BitKeeper/deleted/.del-sel000032.test~e32da7c3fc4b7ace:
  Delete: mysql-test/t/sel000032.test
BitKeeper/deleted/.del-rpl000003.result~68d6ee00beaa011:
  Delete: mysql-test/r/rpl000003.result
BitKeeper/deleted/.del-rpl000003.test~b7cfc4c5576fbafd:
  Delete: mysql-test/t/rpl000003.test
client/mysql.cc:
  Don't yet print information about SQL help
client/mysqltest.c:
  Added test options:
  --enable_warnings
  --disable_warnings
  --enable_info
  --disable_info
configure.in:
  changed version number of shared libraries
mysql-test/include/master-slave.inc:
  Don't write warnings on init
mysql-test/r/backup.result:
  Updated results
mysql-test/r/bdb.result:
  Updated results
mysql-test/r/bigint.result:
  Updated results
mysql-test/r/bool.result:
  Updated results
mysql-test/r/create.result:
  Updated results
mysql-test/r/delete.result:
  Updated results
mysql-test/r/derived.result:
  Updated results
mysql-test/r/distinct.result:
  Updated results
mysql-test/r/drop.result:
  Updated results
mysql-test/r/flush.result:
  Updated results
mysql-test/r/fulltext.result:
  Updated results
mysql-test/r/fulltext_multi.result:
  Updated results
mysql-test/r/fulltext_order_by.result:
  Updated results
mysql-test/r/func_equal.result:
  Updated results
mysql-test/r/func_in.result:
  Updated results
mysql-test/r/func_set.result:
  Updated results
mysql-test/r/gcc296.result:
  Updated results
mysql-test/r/group_by.result:
  Updated results
mysql-test/r/innodb-deadlock.result:
  Updated results
mysql-test/r/innodb.result:
  Updated results
mysql-test/r/innodb_cache.result:
  Updated results
mysql-test/r/innodb_handler.result:
  Updated results
mysql-test/r/insert.result:
  Updated results
mysql-test/r/insert_select.result:
  Updated results
mysql-test/r/isam.result:
  Updated results
mysql-test/r/join_outer.result:
  Updated results
mysql-test/r/key.result:
  Updated results
mysql-test/r/merge.result:
  Updated results
mysql-test/r/multi_update.result:
  Updated results
mysql-test/r/myisam.result:
  Updated results
mysql-test/r/null.result:
  Updated results
mysql-test/r/null_key.result:
  Updated results
mysql-test/r/odbc.result:
  Updated results
mysql-test/r/olap.result:
  Updated results
mysql-test/r/order_by.result:
  Updated results
mysql-test/r/query_cache.result:
  Updated results
mysql-test/r/rename.result:
  Updated results
mysql-test/r/row.result:
  Updated results
mysql-test/r/rpl000001.result:
  Updated results
mysql-test/r/rpl000002.result:
  Updated results
mysql-test/r/rpl000004.result:
  Updated results
mysql-test/r/rpl000005.result:
  Updated results
mysql-test/r/rpl000006.result:
  Updated results
mysql-test/r/rpl000008.result:
  Updated results
mysql-test/r/rpl000009.result:
  Updated results
mysql-test/r/rpl000010.result:
  Updated results
mysql-test/r/rpl000011.result:
  Updated results
mysql-test/r/rpl000012.result:
  Updated results
mysql-test/r/rpl000013.result:
  Updated results
mysql-test/r/rpl_alter.result:
  Updated results
mysql-test/r/rpl_empty_master_crash.result:
  Updated results
mysql-test/r/rpl_redirect.result:
  Updated results
mysql-test/r/rpl_replicate_do.result:
  Updated results
mysql-test/r/rpl_rotate_logs.result:
  Updated results
mysql-test/r/rpl_skip_error.result:
  Updated results
mysql-test/r/rpl_temporary.result:
  Updated results
mysql-test/r/select.result:
  Updated results
mysql-test/r/subselect.result:
  Updated results
mysql-test/r/temp_table.result:
  Updated results
mysql-test/r/type_date.result:
  Updated results
mysql-test/r/type_float.result:
  Updated results
mysql-test/r/union.result:
  Updated results
mysql-test/r/update.result:
  Updated results
mysql-test/r/user_var.result:
  Updated results
mysql-test/r/varbinary.result:
  Updated results
mysql-test/r/variables.result:
  Updated results
mysql-test/r/warnings.result:
  Updated results
mysql-test/t/alias.test:
  Don't write warnings when initializing test
mysql-test/t/alter_table.test:
  Don't write warnings when initializing test
mysql-test/t/analyse.test:
  Don't write warnings when initializing test
mysql-test/t/auto_increment.test:
  Don't write warnings when initializing test
mysql-test/t/backup.test:
  Don't write warnings when initializing test
mysql-test/t/bdb-alter-table-1.test:
  Don't write warnings when initializing test
mysql-test/t/bdb-crash.test:
  Don't write warnings when initializing test
mysql-test/t/bdb-deadlock.test:
  Don't write warnings when initializing test
mysql-test/t/bdb.test:
  Don't write warnings when initializing test
  cleaned up test
mysql-test/t/bdb_cache.test:
  Don't write warnings when initializing test
mysql-test/t/bench_count_distinct.test:
  Don't write warnings when initializing test
mysql-test/t/bigint.test:
  Don't write warnings when initializing test
mysql-test/t/binary.test:
  Don't write warnings when initializing test
mysql-test/t/bool.test:
  Don't write warnings when initializing test
  Changed to use standard table names
mysql-test/t/bulk_replace.test:
  Don't write warnings when initializing test
mysql-test/t/case.test:
  Don't write warnings when initializing test
mysql-test/t/check.test:
  Don't write warnings when initializing test
mysql-test/t/compare.test:
  Don't write warnings when initializing test
mysql-test/t/connect.test:
  Removed empty line
mysql-test/t/constraints.test:
  Don't write warnings when initializing test
mysql-test/t/count_distinct.test:
  Don't write warnings when initializing test
mysql-test/t/count_distinct2.test:
  Don't write warnings when initializing test
mysql-test/t/create.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/ctype_latin1_de.test:
  Don't write warnings when initializing test
mysql-test/t/ctype_many.test:
  Don't write warnings when initializing test
mysql-test/t/delayed.test:
  Don't write warnings when initializing test
mysql-test/t/delete.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/derived.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/dirty_close.test:
  Don't write warnings when initializing test
mysql-test/t/distinct.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/drop.test:
  Don't write warnings when initializing test
mysql-test/t/empty_table.test:
  Don't write warnings when initializing test
mysql-test/t/err000001.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/explain.test:
  Don't write warnings when initializing test
mysql-test/t/flush.test:
  Don't write warnings when initializing test
mysql-test/t/foreign_key.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext_cache.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext_distinct.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext_left_join.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext_multi.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext_order_by.test:
  Don't write warnings when initializing test
mysql-test/t/fulltext_update.test:
  Don't write warnings when initializing test
mysql-test/t/func_concat.test:
  Don't write warnings when initializing test
mysql-test/t/func_date_add.test:
  Don't write warnings when initializing test
mysql-test/t/func_encrypt.test:
  Don't write warnings when initializing test
mysql-test/t/func_equal.test:
  Don't write warnings when initializing test
mysql-test/t/func_group.test:
  Don't write warnings when initializing test
mysql-test/t/func_if.test:
  Don't write warnings when initializing test
mysql-test/t/func_in.test:
  Don't write warnings when initializing test
mysql-test/t/func_isnull.test:
  Don't write warnings when initializing test
mysql-test/t/func_like.test:
  Don't write warnings when initializing test
mysql-test/t/func_regexp.test:
  Don't write warnings when initializing test
mysql-test/t/func_set.test:
  Don't write warnings when initializing test
  Merged test with other tests
mysql-test/t/func_str.test:
  Don't write warnings when initializing test
mysql-test/t/func_time.test:
  Don't write warnings when initializing test
mysql-test/t/func_timestamp.test:
  Don't write warnings when initializing test
mysql-test/t/gcc296.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/grant_cache.test:
  Don't write warnings when initializing test
mysql-test/t/group_by.test:
  Don't write warnings when initializing test
  Cleaned up test
mysql-test/t/handler.test:
  Don't write warnings when initializing test
mysql-test/t/having.test:
  Don't write warnings when initializing test
mysql-test/t/heap.test:
  Don't write warnings when initializing test
mysql-test/t/heap_auto_increment.test:
  Don't write warnings when initializing test
mysql-test/t/heap_btree.test:
  Don't write warnings when initializing test
mysql-test/t/heap_hash.test:
  Don't write warnings when initializing test
mysql-test/t/innodb-deadlock.test:
  Don't write warnings when initializing test
mysql-test/t/innodb.test:
  Don't write warnings when initializing test
mysql-test/t/innodb_cache.test:
  Don't write warnings when initializing test
mysql-test/t/innodb_handler.test:
  Don't write warnings when initializing test
mysql-test/t/ins000001.test:
  Don't write warnings when initializing test
mysql-test/t/insert.test:
  Don't write warnings when initializing test
  cleaned up test.
  Changed to use standard database and table names
mysql-test/t/insert_select.test:
  Don't write warnings when initializing test
  Changed to use standard table names
mysql-test/t/insert_update.test:
  Don't write warnings when initializing test
mysql-test/t/isam.test:
  Don't write warnings when initializing test
  cleaned up test
mysql-test/t/join.test:
  Don't write warnings when initializing test
mysql-test/t/join_crash.test:
  Don't write warnings when initializing test
mysql-test/t/join_outer.test:
  Don't write warnings when initializing test
mysql-test/t/key.test:
  Don't write warnings when initializing test
mysql-test/t/key_diff.test:
  Don't write warnings when initializing test
mysql-test/t/key_primary.test:
  Don't write warnings when initializing test
mysql-test/t/keywords.test:
  Don't write warnings when initializing test
mysql-test/t/kill.test:
  Don't write warnings when initializing test
mysql-test/t/limit.test:
  Don't write warnings when initializing test
mysql-test/t/lock.test:
  Don't write warnings when initializing test
mysql-test/t/lock_multi.test:
  Don't write warnings when initializing test
mysql-test/t/lowercase_table.test:
  Don't write warnings when initializing test
mysql-test/t/merge.test:
  Don't write warnings when initializing test
  cleaned up test
mysql-test/t/multi_update.test:
  Don't write warnings when initializing test
mysql-test/t/myisam.test:
  Don't write warnings when initializing test
mysql-test/t/null.test:
  Don't write warnings when initializing test
mysql-test/t/null_key.test:
  Don't write warnings when initializing test
mysql-test/t/odbc.test:
  Don't write warnings when initializing test
mysql-test/t/olap.test:
  Don't write warnings when initializing test
mysql-test/t/order_by.test:
  Don't write warnings when initializing test
mysql-test/t/order_fill_sortbuf.test:
  Don't write warnings when initializing test
mysql-test/t/query_cache.test:
  Don't write warnings when initializing test
mysql-test/t/raid.test:
  Don't write warnings when initializing test
mysql-test/t/range.test:
  Don't write warnings when initializing test
mysql-test/t/rename.test:
  Don't write warnings when initializing test
mysql-test/t/repair.test:
  Don't write warnings when initializing test
mysql-test/t/replace.test:
  Don't write warnings when initializing test
mysql-test/t/rollback.test:
  Don't write warnings when initializing test
mysql-test/t/row.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000001.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000002.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000004.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000005.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000006.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000008-slave.opt:
  Don't write warnings when initializing test
mysql-test/t/rpl000008.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000009-slave.opt:
  Don't write warnings when initializing test
mysql-test/t/rpl000009.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000010.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000011.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000012.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000013.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000015.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000017.test:
  Don't write warnings when initializing test
mysql-test/t/rpl000018.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_alter.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_empty_master_crash.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_redirect.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_replicate_do.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_rotate_logs.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_skip_error.test:
  Don't write warnings when initializing test
mysql-test/t/rpl_temporary.test:
  Don't write warnings when initializing test
mysql-test/t/sel000033.test:
  Don't write warnings when initializing test
mysql-test/t/sel000100.test:
  Don't write warnings when initializing test
mysql-test/t/select.test:
  Don't write warnings when initializing test
mysql-test/t/select_found.test:
  Don't write warnings when initializing test
mysql-test/t/select_safe.test:
  Don't write warnings when initializing test
mysql-test/t/show_check.test:
  Don't write warnings when initializing test
mysql-test/t/status.test:
  Don't write warnings when initializing test
mysql-test/t/subselect.test:
  Don't write warnings when initializing test
mysql-test/t/symlink.test:
  Don't write warnings when initializing test
mysql-test/t/tablelock.test:
  Don't write warnings when initializing test
mysql-test/t/temp_table.test:
  Don't write warnings when initializing test
mysql-test/t/truncate.test:
  Don't write warnings when initializing test
mysql-test/t/type_blob.test:
  Don't write warnings when initializing test
mysql-test/t/type_date.test:
  Don't write warnings when initializing test
mysql-test/t/type_datetime.test:
  Don't write warnings when initializing test
mysql-test/t/type_decimal.test:
  Don't write warnings when initializing test
mysql-test/t/type_enum.test:
  Don't write warnings when initializing test
mysql-test/t/type_float.test:
  Don't write warnings when initializing test
mysql-test/t/type_ranges.test:
  Don't write warnings when initializing test
mysql-test/t/type_set.test:
  Don't write warnings when initializing test
mysql-test/t/type_time.test:
  Don't write warnings when initializing test
mysql-test/t/type_timestamp.test:
  Don't write warnings when initializing test
mysql-test/t/type_uint.test:
  Don't write warnings when initializing test
mysql-test/t/type_year.test:
  Don't write warnings when initializing test
mysql-test/t/union.test:
  Don't write warnings when initializing test
mysql-test/t/update.test:
  Don't write warnings when initializing test
mysql-test/t/user_var.test:
  Don't write warnings when initializing test
mysql-test/t/varbinary.test:
  Don't write warnings when initializing test
mysql-test/t/variables.test:
  Don't write warnings when initializing test
mysql-test/t/warnings.test:
  Don't write warnings when initializing test
mysys/my_vsnprintf.c:
  Safety fix
readline/terminal.c:
  Removed compiler warnings
sql/ha_berkeley.cc:
  Indentation changes
sql/mysql_priv.h:
  Change store_warning -> push_warning_printf
sql/sql_db.cc:
  Change store_warning -> push_warning_printf
sql/sql_error.cc:
  Change store_warning -> push_warning_printf
sql/sql_table.cc:
  Change store_warning -> push_warning_printf
parent 8ce6c9fc
......@@ -389,9 +389,11 @@ int main(int argc,char *argv[])
}
}
#endif
sprintf(buff, "%s%s",
"Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n",
sprintf(buff, "%s",
"Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n");
#ifdef NOT_YET
"Type 'help [[%]function name[%]]' to get help on usage of function.\n");
#endif
put_info(buff,INFO_INFO);
status.exit_status=read_lines(1); // read lines and execute them
if (opt_outfile)
......@@ -663,7 +665,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_nopager= 1;
case OPT_MYSQL_PROTOCOL:
{
if ((opt_protocol = find_type(argument, &sql_protocol_typelib,0)) == ~(ulong) 0)
if ((opt_protocol = find_type(argument, &sql_protocol_typelib,0)) ==
~(ulong) 0)
{
fprintf(stderr, "Unknown option to protocol: %s\n", argument);
exit(1);
......@@ -1299,7 +1302,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
sizeof(char *) *
(num_fields*2+1))))
break;
field_names[i][num_fields*2]='\0';
field_names[i][num_fields*2]= '\0';
j=0;
while ((sql_field=mysql_fetch_field(fields)))
{
......@@ -1319,7 +1322,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
{
tee_fprintf(stdout,
"Didn't find any fields in table '%s'\n",table_row[0]);
field_names[i]=0;
field_names[i]= 0;
}
i++;
}
......@@ -1407,17 +1410,15 @@ static int com_server_help(String *buffer __attribute__((unused)),
MYSQL_ROW cur;
const char *server_cmd= buffer->ptr();
char cmd_buf[100];
MYSQL_RES *result;
int error;
if (help_arg[0]!='\'')
if (help_arg[0] != '\'')
{
(void*)sprintf(cmd_buf,"help \'%s\';",help_arg);
(void) strxnmov(cmd_buf, sizeof(cmd_buf), "help '", help_arg, "'", NullS);
server_cmd= cmd_buf;
}
MYSQL_RES *result;
ulong timer;
uint error= 0;
if (!status.batch)
{
old_buffer= *buffer;
......@@ -1427,26 +1428,24 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (!connected && reconnect())
return 1;
timer= start_timer();
error= mysql_real_query_for_lazy(server_cmd,strlen(server_cmd));
if (error)
if ((error= mysql_real_query_for_lazy(server_cmd,strlen(server_cmd))))
return error;
error= mysql_store_result_for_lazy(&result);
if (error)
if ((error= mysql_store_result_for_lazy(&result)))
return error;
if (result)
{
int num_rows= mysql_num_rows(result);
if (num_rows==1)
if (num_rows == 1)
{
if (!(cur= mysql_fetch_row(result)))
return -1;
{
error= -1;
goto err;
}
init_pager();
if (cur[1][0]=='Y')
if (cur[1][0] == 'Y')
{
tee_fprintf(PAGER, "\nHelp topic \'%s\'\n", cur[0]);
tee_fprintf(PAGER, "%s\n", cur[2]);
......@@ -1460,17 +1459,19 @@ static int com_server_help(String *buffer __attribute__((unused)),
}
end_pager();
}
else if (num_rows>1)
else if (num_rows > 1)
{
put_info("\nMany help items for your request exist", INFO_INFO);
put_info("For more specific request please type 'help <item>' where item is one of next :", INFO_INFO);
init_pager();
char last_char= '_';
while ((cur= mysql_fetch_row(result))){
if (cur[1][0]!=last_char){
while ((cur= mysql_fetch_row(result)))
{
if (cur[1][0]!=last_char)
{
put_info("-------------------------------------------", INFO_INFO);
put_info(cur[1][0]=='Y' ?
put_info(cur[1][0] == 'Y' ?
"categories:" : "functions:", INFO_INFO);
put_info("-------------------------------------------", INFO_INFO);
}
......@@ -1486,6 +1487,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
}
}
err:
mysql_free_result(result);
return error;
}
......
......@@ -166,7 +166,8 @@ typedef struct
VAR var_reg[10];
/*Perl/shell-like variable registers */
HASH var_hash;
int disable_query_log=0, disable_result_log=0;
my_bool disable_query_log=0, disable_result_log=0, disable_warnings=0;
my_bool disable_info= 1; /* By default off */
struct connection cons[MAX_CONS];
struct connection* cur_con, *next_con, *cons_end;
......@@ -195,6 +196,8 @@ Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER,
Q_WAIT_FOR_SLAVE_TO_STOP,
Q_REQUIRE_VERSION,
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
Q_ENABLE_INFO, Q_DISABLE_INFO,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND
......@@ -253,6 +256,10 @@ const char *command_names[]=
"require_manager",
"wait_for_slave_to_stop",
"require_version",
"enable_warnings",
"disable_warnings",
"enable_info",
"diable_info",
0
};
......@@ -2169,17 +2176,17 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
verbose_msg("query '%s' failed: %d: %s", q->query, mysql_errno(mysql),
mysql_error(mysql));
/*
if we do not abort on error, failure to run the query does
not fail the whole test case
if we do not abort on error, failure to run the query does
not fail the whole test case
*/
goto end;
}
/*{
verbose_msg("failed in mysql_store_result for query '%s' (%d)", query,
mysql_errno(mysql));
mysql_errno(mysql));
error = 1;
goto end;
}*/
}*/
}
if (q->expected_errno[0])
......@@ -2190,39 +2197,49 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
goto end;
}
if (!disable_result_log && res)
if (!disable_result_log)
{
int num_fields= mysql_num_fields(res);
MYSQL_FIELD *fields= mysql_fetch_fields(res);
for (i = 0; i < num_fields; i++)
if (res)
{
if (i)
dynstr_append_mem(ds, "\t", 1);
dynstr_append(ds, fields[i].name);
int num_fields= mysql_num_fields(res);
MYSQL_FIELD *fields= mysql_fetch_fields(res);
for (i = 0; i < num_fields; i++)
{
if (i)
dynstr_append_mem(ds, "\t", 1);
dynstr_append(ds, fields[i].name);
}
dynstr_append_mem(ds, "\n", 1);
append_result(ds, res);
}
dynstr_append_mem(ds, "\n", 1);
append_result(ds, res);
}
/* Add all warnings to the result */
if (!disable_result_log && mysql_warning_count(mysql))
{
MYSQL_RES *warn_res=0;
uint count= mysql_warning_count(mysql);
if (!mysql_real_query(mysql, "SHOW WARNINGS", 13))
/* Add all warnings to the result */
if (!disable_warnings && mysql_warning_count(mysql))
{
warn_res=mysql_store_result(mysql);
MYSQL_RES *warn_res=0;
uint count= mysql_warning_count(mysql);
if (!mysql_real_query(mysql, "SHOW WARNINGS", 13))
{
warn_res=mysql_store_result(mysql);
}
if (!warn_res)
verbose_msg("Warning count is %u but didn't get any warnings\n",
count);
else
{
dynstr_append_mem(ds, "Warnings:\n", 10);
append_result(ds, warn_res);
mysql_free_result(warn_res);
}
}
if (!warn_res)
verbose_msg("Warning count is %u but didn't get any warnings\n",
count);
else
if (!disable_info && mysql_info(mysql))
{
dynstr_append_mem(ds, "Warnings:\n", 10);
append_result(ds, warn_res);
mysql_free_result(warn_res);
dynstr_append(ds, "info: ");
dynstr_append(ds, mysql_info(mysql));
dynstr_append_mem(ds, "\n", 1);
}
}
if (glob_replace)
free_replace();
......@@ -2431,6 +2448,10 @@ int main(int argc, char** argv)
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
case Q_ENABLE_INFO: disable_info=0; break;
case Q_DISABLE_INFO: disable_info=1; break;
case Q_SOURCE: do_source(q); break;
case Q_SLEEP: do_sleep(q, 0); break;
case Q_REAL_SLEEP: do_sleep(q, 1); break;
......
......@@ -10,7 +10,7 @@ AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10
DOT_FRM_VERSION=6
# See the libtool docs for information on how to do shared lib versions.
SHARED_LIB_VERSION=12:0:0
SHARED_LIB_VERSION=14:0:0
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
......
......@@ -7,12 +7,16 @@ connection slave;
!stop slave;
@r/slave-stopped.result show status like 'Slave_running';
connection master;
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
reset master;
connection slave;
reset slave;
# Clean up old test tables
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
start slave;
@r/slave-running.result show status like 'Slave_running';
......
set SQL_LOG_BIN=0;
drop table if exists t1;
drop table if exists t1, t2, t3;
create table t1(n int);
backup table t1 to '../bogus';
Table Op Msg_type Msg_text
......
......@@ -797,7 +797,6 @@ select * from t1 where i=1 and j=2;
i j
1 2
drop table t1;
drop table if exists t1, t2, t3, t4, t5, t6, t7;
create table t1
(
branch_id int auto_increment primary key,
......@@ -806,7 +805,6 @@ branch_active int not null default 1,
unique branch_name(branch_name),
index branch_active(branch_active)
) type=bdb;
drop table if exists t2 ;
create table t2
(
target_id int auto_increment primary key,
......@@ -815,7 +813,6 @@ target_active int not null default 1,
unique target_name(target_name),
index target_active(target_active)
) type=bdb;
drop table if exists t3 ;
create table t3
(
platform_id int auto_increment primary key,
......@@ -824,7 +821,6 @@ platform_active int not null default 1,
unique platform_name(platform_name),
index platform_active(platform_active)
) type=bdb;
drop table if exists t4 ;
create table t4
(
product_id int auto_increment primary key,
......@@ -834,7 +830,6 @@ product_active int not null default 1,
unique product_name(product_name),
index product_active(product_active)
) type=bdb;
drop table if exists t5 ;
create table t5
(
product_file_id int auto_increment primary key,
......@@ -847,7 +842,6 @@ file_included int not null default 1,
unique product_file(product_id,file_name),
index file_included(file_included)
) type=bdb;
drop table if exists t6 ;
create table t6
(
file_platform_id int auto_increment primary key,
......@@ -860,7 +854,6 @@ build_filename varchar(255) not null,
archive_filename varchar(255) not null,
unique file_platform(product_file_id,platform_id,branch_id)
) type=bdb;
drop table if exists t8 ;
create table t8
(
archive_id int auto_increment primary key,
......@@ -872,7 +865,6 @@ status_id int not null default 1,
unique archive(branch_id,target_id,platform_id,product_id),
index status_id(status_id)
) type=bdb;
drop table if exists t7 ;
create table t7
(
build_id int auto_increment primary key,
......@@ -1057,7 +1049,6 @@ KINMU_DATE
select T1.KINMU_DATE from t1 T1 ,t2 T2 where T1.SYAIN_NO = '12345' and T1.KINMU_DATE = '200106' and T2.SYAIN_NO = T1.SYAIN_NO;
KINMU_DATE
DROP TABLE t1,t2;
drop table if exists t1;
create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
insert into t1 values (1,1), (1,2);
select * from t1 where a = 1;
......
drop table if exists t1;
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296
......@@ -7,7 +8,6 @@ select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999;
+9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000
drop table if exists t1;
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1;
......
......@@ -46,10 +46,9 @@ SELECT @a, @b;
@a @b
0 6
DROP TABLE t1;
drop table if exists t;
create table t(a int, b int);
insert into t values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t;
create table t1 (a int, b int);
insert into t1 values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N
0 N 1 N 0 1 1 N N N
......@@ -60,7 +59,7 @@ N 1 N 0 N N N 1 0 0
0 1 1 0 0 1 1 1 0 0
1 0 0 1 0 1 1 1 0 0
1 1 0 0 1 0 0 1 0 0
select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t;
select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N
0 N 1 N 0 1 1 N N N
......@@ -71,4 +70,4 @@ N 1 N 0 N N N 1 0 0
0 1 1 0 0 1 1 1 0 0
1 0 0 1 0 1 1 1 0 0
1 1 0 0 1 0 0 1 0 0
drop table t;
drop table t1;
......@@ -13,12 +13,15 @@ select * from t1;
b
drop table if exists t1;
drop table t1;
create table t2 type=heap select * from t1;
Table 'test.t1' doesn't exist
create table t2 select auto+1 from t1;
Table 'test.t1' doesn't exist
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
create table t1 (b char(0) not null, index(b));
The used table handler can't index column 'b'
create table t1 (a int not null auto_increment,primary key (a)) type=heap;
......@@ -48,6 +51,8 @@ drop table 1ea10;
create table t1 (t1.index int);
drop table t1;
drop database if exists test_$1;
Warnings:
Note 1008 Can't drop database 'test_$1'. Database doesn't exist
create database test_$1;
create table test_$1.$test1 (a$1 int, $b int, c$ int);
insert into test_$1.$test1 values (1,2,3);
......@@ -105,12 +110,18 @@ drop table if exists t2;
create table t2 (a int, a float) select * from t1;
Duplicate column name 'a'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
create table t2 (a int) select a as b, a+1 as b from t1;
Duplicate column name 'b'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
create table t2 (b int) select a as b, a+1 as b from t1;
Duplicate column name 'b'
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't2'
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
Table Create Table
......@@ -161,7 +172,6 @@ drop table if exists t1;
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
drop table if exists t1, t2, t3;
create table t1(id int not null, name char(20));
insert into t1 values(10,'mysql'),(20,'monty- the creator');
create table t2(id int not null);
......@@ -200,6 +210,8 @@ select * from t3;
id name
drop table t2, t3;
drop database if exists test_$1;
Warnings:
Note 1008 Can't drop database 'test_$1'. Database doesn't exist
create database test_$1;
create table test_$1.t3 like t1;
create temporary table t3 like test_$1.t3;
......
......@@ -24,7 +24,6 @@ create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a));
insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27);
delete from t1 where a=27;
drop table t1;
drop table if exists t;
CREATE TABLE `t` (
`i` int(10) NOT NULL default '0',
`i2` int(10) NOT NULL default '0',
......
drop table if exists t1,t2,t3;
select * from (select 2 from DUAL) b;
2
2
......@@ -5,7 +6,6 @@ SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
Unknown column 'a' in 'field list'
drop table if exists t1,t2,t3;
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null);
......@@ -60,7 +60,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY x1 ALL NULL NULL NULL NULL 4
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
2 DERIVED x1 ALL NULL NULL NULL NULL 4
drop table if exists t1.t2,t3;
drop table if exists t2,t3;
select * from (select 1) as a;
1
1
......@@ -123,7 +123,7 @@ explain select count(*) from t1 as tt1, (select * from t1) as tt2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2 DERIVED tt1 index NULL a 4 NULL 10000 Using index
drop table if exists t1;
drop table t1;
SELECT * FROM (SELECT (SELECT * FROM (SELECT 1 as a) as a )) as b;
(SELECT * FROM (SELECT 1 as a) as a )
1
......
......@@ -326,7 +326,6 @@ AND ((t1.id=j_lj_t3.id AND t3_lj.id IS NULL) OR (t1.id=t3.id AND t3.idx=2));
id
2
drop table t1,t2,t3;
drop table if exists t1;
create table t1 (a int not null, b int not null, t time);
insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15");
select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
......@@ -410,7 +409,7 @@ INSERT INTO t2 VALUES (33,6,'Kevin','0','kevin@stileproject.com',1,'',0,'http://
SELECT DISTINCT t1.*, t2.* FROM t1 LEFT JOIN t2 ON (t2.userid = t1.touserid);
privatemessageid folderid userid touserid fromuserid title message dateline showsignature iconid messageread readtime receipt deleteprompt multiplerecipients userid usergroupid username password email styleid parentemail coppauser homepage icq aim yahoo signature adminemail showemail invisible usertitle customtitle joindate cookieuser daysprune lastvisit lastactivity lastpost posts timezoneoffset emailnotification buddylist ignorelist pmfolders receivepm emailonpm pmpopup avatarid avatarrevision options birthday maxposts startofweek ipaddress referrerid nosessionhash autorefresh messagepopup inforum ratenum ratetotal allowrate
128 0 33 33 8 :D 996121863 1 0 2 996122850 2 0 0 33 6 Kevin 0 kevin@stileproject.com 1 0 http://www.stileproject.com 1 1 0 Administrator 0 996120694 1 -1 1030996168 1031027028 1030599436 36 -6 0 1 0 1 0 0 15 0000-00-00 -1 1 64.0.0.0 0 1 -1 0 0 4 19 1
DROP TABLE IF EXISTS t1,t2;
DROP TABLE t1,t2;
CREATE TABLE t1 (a int primary key, b int, c int);
INSERT t1 VALUES (1,2,3);
CREATE TABLE t2 (a int primary key, b int, c int);
......@@ -418,4 +417,4 @@ INSERT t2 VALUES (3,4,5);
SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
a b
1 4
DROP TABLE IF EXISTS t1,t2;
DROP TABLE t1,t2;
drop table if exists t1;
drop table if exists t1;
drop table t1;
Unknown table 't1'
create table t1(n int);
......@@ -13,6 +12,8 @@ select * from t1;
n
1
drop database if exists mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
create database mysqltest;
drop database if exists mysqltest;
create database mysqltest;
......@@ -25,6 +26,8 @@ drop database if exists mysqltest;
create database mysqltest;
drop database mysqltest;
drop database if exists mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
flush tables with read lock;
create database mysqltest;
Got one of the listed errors
......
drop table if exists t1;
drop table if exists t1,t2;
drop database if exists mysqltest;
create temporary table t1(n int not null primary key);
drop table if exists t2;
create table t2(n int);
insert into t2 values(3);
select * from t1;
......@@ -11,7 +11,6 @@ drop table t2;
Table 't2' was locked with a READ lock and can't be updated
drop table t2;
unlock tables;
drop database if exists mysqltest;
create database mysqltest;
create table mysqltest.t1(n int);
insert into mysqltest.t1 values (23);
......
......@@ -206,7 +206,6 @@ select 8 from t1;
8
8
drop table t1;
drop table if exists t1;
create table t1 (a text, fulltext key (a));
insert into t1 values ('aaaa');
repair table t1;
......
use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a int(11) NOT NULL auto_increment,
......
use test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY,
......
drop table if exists t1,t2;
select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL;
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1
......@@ -10,7 +11,6 @@ select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
select "A"<=>"B","A"<=>NULL,NULL<=>"A";
"A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0
drop table if exists t1,t2;
create table t1 (id int, value int);
create table t2 (id int, value int);
insert into t1 values (1,null);
......
drop table if exists t1;
select 1 in (1,2,3);
1 in (1,2,3)
1
......@@ -34,7 +35,6 @@ select 3.5 in (1.5,NULL,3.5);
select 10.5 in (1.5,NULL,3.5);
10.5 in (1.5,NULL,3.5)
NULL
drop table if exists t1;
CREATE TABLE t1 (a int, b int, c int);
insert into t1 values (1,2,3), (1,NULL,3);
select 1 in (a,b,c) from t1;
......
......@@ -25,3 +25,20 @@ find_in_set("","a,b,c") find_in_set("","a,b,c,") find_in_set("",",a,b,c")
select find_in_set("abc","abc"),find_in_set("ab","abc"),find_in_set("abcd","abc");
find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
1 0 0
drop table if exists t1,t2;
create table t1 (id int(10) not null unique);
create table t2 (id int(10) not null primary key,
val int(10) not null);
insert into t1 values (1),(2),(4);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
id elt(two.val,'one','two')
1 one
2 one
4 two
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
id elt(two.val,'one','two')
1 one
2 one
4 two
drop table t1,t2;
drop table if exists obory;
CREATE TABLE obory (
drop table if exists t1;
CREATE TABLE t1 (
kodoboru varchar(10) default NULL,
obor tinytext,
aobor tinytext,
......@@ -7,14 +7,14 @@ UNIQUE INDEX kodoboru (kodoboru),
FULLTEXT KEY obor (obor),
FULLTEXT KEY aobor (aobor)
);
INSERT INTO obory VALUES ('0101000000','aaa','AAA');
INSERT INTO obory VALUES ('0102000000','bbb','BBB');
INSERT INTO obory VALUES ('0103000000','ccc','CCC');
INSERT INTO obory VALUES ('0104000000','xxx','XXX');
select * from obory;
INSERT INTO t1 VALUES ('0101000000','aaa','AAA');
INSERT INTO t1 VALUES ('0102000000','bbb','BBB');
INSERT INTO t1 VALUES ('0103000000','ccc','CCC');
INSERT INTO t1 VALUES ('0104000000','xxx','XXX');
select * from t1;
kodoboru obor aobor
0101000000 aaa AAA
0102000000 bbb BBB
0103000000 ccc CCC
0104000000 xxx XXX
drop table obory;
drop table t1;
drop table if exists t1,t2,t3;
SELECT 1 FROM (SELECT 1) as a GROUP BY SUM(1);
Invalid use of group function
drop table if exists t1,t2,t3;
CREATE TABLE t1 (
spID int(10) unsigned,
userID int(10) unsigned,
......@@ -42,7 +42,7 @@ SELECT t2.userid, MIN(t1.score+0.0) FROM t1, t2 WHERE t1.userID=t2.userID AND t1
userid MIN(t1.score+0.0)
1 1.0
2 2.0
drop table test.t1,test.t2;
drop table t1,t2;
CREATE TABLE t1 (
PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
payDate date DEFAULT '0000-00-00' NOT NULL,
......@@ -390,7 +390,6 @@ CONCAT(a, b) count(*)
abcdef 1
hijklm 2
DROP TABLE t1;
drop table if exists t1;
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned);
insert into t1 values (1,2,1,4),(1,2,2,4),(1,2,3,4),(1,2,4,4),(1,1,1,4),(1,1,2,4),(1,1,3,4),(1,1,4,4),(1,3,1,4),(1,3,2,4),(1,3,3,4),(1,3,4,4);
select One, Two, sum(Four) from t1 group by One,Two;
......
drop table if exists t1;
drop table if exists t1,t2;
create table t1 (id integer, x integer) type=INNODB;
insert into t1 values(0, 0);
set autocommit=0;
......@@ -18,7 +18,6 @@ id x
0 2
commit;
drop table t1;
drop table if exists t1, t2;
create table t1 (id integer, x integer) type=INNODB;
create table t2 (b integer, a integer) type=INNODB;
insert into t1 values(0, 0), (300, 300);
......
......@@ -1021,7 +1021,6 @@ id code name
7 4 Matt
COMMIT;
DROP TABLE t1;
drop table if exists t1,t2;
create table t1 (n int(10), d int(10)) type=innodb;
create table t2 (n int(10), d int(10)) type=innodb;
insert into t1 values(1,1),(1,2);
......
drop table if exists t1, t2, t3;
drop table if exists t1,t2,t3;
flush status;
set autocommit=0;
create table t1 (a int not null) type=innodb;
......
drop table if exists t1;
drop table if exists t1,t2;
create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb;
insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
......
......@@ -58,9 +58,9 @@ skr 2
test 1
test 2
drop table t1;
drop database if exists foo;
create database foo;
use foo;
drop database if exists test_$1;
create database test_$1;
use test_$1;
create table t1 (c int);
insert into foo.t1 set foo.t1.c = '1';
drop database foo;
insert into test_$1.t1 set test_$1.t1.c = '1';
drop database test_$1;
......@@ -21,8 +21,7 @@ payoutID
20
22
drop table t1,t2;
DROP TABLE IF EXISTS crash1,crash2;
CREATE TABLE `crash1` (
CREATE TABLE `t1` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment,
......@@ -37,7 +36,7 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;
CREATE TABLE `crash2` (
CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment,
......@@ -52,17 +51,17 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`)
) TYPE=MyISAM;
INSERT INTO crash2
INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53'
,3649052399,0);
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2
INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%';
Variable_name Value
bulk_insert_buffer_size 8388608
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2
INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC;
DROP TABLE IF EXISTS crash1,crash2;
DROP TABLE IF EXISTS t1,t2;
......@@ -38,6 +38,8 @@ Incorrect table definition; There can only be one auto column and it must be def
create table t1 (ordid int(8), unique (ordid)) type=isam;
Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
create table t2 type=isam select * from t1;
......
......@@ -181,7 +181,6 @@ SELECT t1.usr_id,t1.uniq_id,t1.increment,t2.usr2_id,t2.c_amount,t2.max FROM t1 L
usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL
drop table t1,t2;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
cod_asig int(11) DEFAULT '0' NOT NULL,
desc_larga_cat varchar(80) DEFAULT '' NOT NULL,
......
......@@ -147,7 +147,6 @@ t1 0 e 1 e A 0 NULL NULL BTREE
t1 0 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE
drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
UNIQUE (c,i));
INSERT INTO t1 (c) VALUES (NULL),(NULL);
......
......@@ -181,6 +181,8 @@ Can't open file: 't4.MRG'. (errno: 143)
create table t5 (a int not null, b char(10), key(a)) type=MERGE UNION=(test.t1,test_2.t2);
Incorrect table definition; All MERGE tables must be in the same database
drop table if exists t5,t4,t3,t1,t2;
Warnings:
Note 1051 Unknown table 't5'
create table t1 (c char(10)) type=myisam;
create table t2 (c char(10)) type=myisam;
create table t3 (c char(10)) union=(t1,t2) type=merge;
......@@ -262,7 +264,6 @@ create table t1 (a int not null) type=merge;
select * from t1;
a
drop table t1;
drop table if exists t3, t2, t1;
create table t1 (a int not null, b int not null, key(a,b));
create table t2 (a int not null, b int not null, key(a,b));
create table t3 (a int not null, b int not null, key(a,b)) TYPE=MERGE UNION=(t1,t2);
......@@ -274,7 +275,6 @@ a b
1 1
1 2
drop table t3,t1,t2;
drop table if exists t6, t5, t4, t3, t2, t1;
create table t1 (a int not null, b int not null auto_increment, primary key(a,b));
create table t2 (a int not null, b int not null auto_increment, primary key(a,b));
create table t3 (a int not null, b int not null, key(a,b)) UNION=(t1,t2) INSERT_METHOD=NO;
......@@ -533,15 +533,14 @@ CREATE TABLE t1 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '
INSERT INTO t1 VALUES (1,1), (2,1);
CREATE TABLE t2 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', PRIMARY KEY (a,b)) TYPE=MyISAM;
INSERT INTO t2 VALUES (1,2), (2,2);
CREATE TABLE t ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
select max(b) from t where a = 2;
CREATE TABLE t3 ( a int(11) NOT NULL default '0', b int(11) NOT NULL default '0', KEY a (a,b)) TYPE=MRG_MyISAM UNION=(t1,t2);
select max(b) from t3 where a = 2;
max(b)
NULL
select max(b) from t1 where a = 2;
max(b)
1
drop table if exists t,t1,t2;
drop table if exists t1, t2, t3, t4, t5, t6;
drop table if exists t3,t1,t2;
create table t1 (a int not null);
create table t2 (a int not null);
insert into t1 values (1);
......@@ -561,7 +560,6 @@ a
1
2
drop table if exists t6, t3, t1, t2, t4, t5;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
fileset_id tinyint(3) unsigned NOT NULL default '0',
file_code varchar(32) NOT NULL default '',
......@@ -595,4 +593,4 @@ EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
AND file_code = '0000000115' LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY,files PRIMARY 33 const,const 1
DROP TABLE IF EXISTS t2, t1;
DROP TABLE t2, t1;
......@@ -96,7 +96,7 @@ id mydate
5 2002-05-12 00:00:00
6 2002-06-22 00:00:00
7 2002-07-22 00:00:00
DROP TABLE IF EXISTS t1,t2,t3;
DROP TABLE t1,t2,t3;
CREATE TABLE IF NOT EXISTS `t1` (
`id` int(11) NOT NULL auto_increment,
`tst` text,
......@@ -125,7 +125,7 @@ ID ParId tst tst1
1 1 MySQL MySQL AB
2 2 MSSQL Microsoft
3 3 ORACLE ORACLE
drop table if exists t1, t2 ;
drop table t1, t2 ;
create table t1 (n numeric(10));
create table t2 (n numeric(10));
insert into t2 values (1),(2),(4),(8),(16),(32);
......@@ -251,7 +251,6 @@ n d
select * from t2;
n d
drop table t1,t2;
drop table if exists t1,t2,t3;
CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
INSERT INTO t1 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'),(10,''),(11,''),(12,''),(13,'');
CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
......@@ -260,4 +259,4 @@ CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT
INSERT INTO t3 VALUES (1,'jedan'),(2,'dva');
update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj;
update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj;
drop table if exists t1,t2,t3;
drop table t1,t2,t3;
......@@ -83,7 +83,6 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
drop table if exists t1;
create table t1 ( t1 char(255), key(t1(250)));
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
......@@ -121,7 +120,6 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
drop table if exists t1;
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
......@@ -286,7 +284,7 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
drop table if exists t1;
drop table t1;
CREATE TABLE `t1` (
`post_id` mediumint(8) unsigned NOT NULL auto_increment,
`topic_id` mediumint(8) unsigned NOT NULL default '0',
......
drop table if exists t1;
select null,\N,isnull(null),isnull(1/0),isnull(1/0 = null),ifnull(null,1),ifnull(null,"TRUE"),ifnull("TRUE","ERROR"),1/0 is null,1 is not null;
NULL NULL isnull(null) isnull(1/0) isnull(1/0 = null) ifnull(null,1) ifnull(null,"TRUE") ifnull("TRUE","ERROR") 1/0 is null 1 is not null
NULL NULL 1 1 1 1 TRUE TRUE 1 1
......@@ -34,7 +35,6 @@ NULL AND 0 0 and NULL
select inet_ntoa(null),inet_aton(null),inet_aton("122.256"),inet_aton("122.226."),inet_aton("");
inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("")
NULL NULL NULL NULL NULL
drop table if exists t1;
create table t1 (x int);
insert into t1 values (null);
select * from t1 where x != 0;
......
drop table if exists t1;
drop table if exists t1,t2;
create table t1 (a int, b int not null,unique key (a,b),index(b)) type=myisam;
insert ignore into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(null,7),(9,9),(8,8),(7,7),(null,9),(null,9),(6,6);
explain select * from t1 where a is null;
......@@ -136,7 +136,6 @@ select * from t1 where b like "6%";
a b c
6 6 0
drop table t1;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
id int(10) unsigned NOT NULL auto_increment,
uniq_id int(10) unsigned default NULL,
......
drop table if exists t1;
select {fn length("hello")}, { date "1997-10-20" };
{fn length("hello")} 1997-10-20
5 1997-10-20
drop table if exists t1;
create table t1 (a int not null auto_increment,b int not null,primary key (a,b));
insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2;
......
drop table if exists sales;
create table sales ( product varchar(32), country varchar(32), year int, profit int);
insert into sales values ( 'Computer', 'India',2000, 1200),
drop table if exists t1;
create table t1 ( product varchar(32), country varchar(32), year int, profit int);
insert into t1 values ( 'Computer', 'India',2000, 1200),
( 'TV', 'United States', 1999, 150),
( 'Calculator', 'United States', 1999,50),
( 'Computer', 'United States', 1999,1500),
......@@ -14,14 +14,14 @@ insert into sales values ( 'Computer', 'India',2000, 1200),
( 'Computer', 'India', 1999,1200),
( 'Computer', 'United States', 2000,1500),
( 'Calculator', 'United States', 2000,75);
select product, country , year, sum(profit) from sales group by product, country, year with cube;
select product, country , year, sum(profit) from t1 group by product, country, year with cube;
This version of MySQL doesn't yet support 'CUBE'
explain select product, country , year, sum(profit) from sales group by product, country, year with cube;
explain select product, country , year, sum(profit) from t1 group by product, country, year with cube;
This version of MySQL doesn't yet support 'CUBE'
select product, country , year, sum(profit) from sales group by product, country, year with rollup;
select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
This version of MySQL doesn't yet support 'ROLLUP'
explain select product, country , year, sum(profit) from sales group by product, country, year with rollup;
explain select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
This version of MySQL doesn't yet support 'ROLLUP'
select product, country , year, sum(profit) from sales group by product, country, year with cube union all select product, country , year, sum(profit) from sales group by product, country, year with rollup;
select product, country , year, sum(profit) from t1 group by product, country, year with cube union all select product, country , year, sum(profit) from t1 group by product, country, year with rollup;
This version of MySQL doesn't yet support 'CUBE'
drop table sales;
drop table t1;
......@@ -222,7 +222,6 @@ DateOfAction TransactionID
1999-07-27 834
1999-07-27 840
drop table t1,t2,t3;
drop table if exists t1;
CREATE TABLE t1 (
member_id int(11) NOT NULL auto_increment,
inschrijf_datum varchar(20) NOT NULL default '',
......
......@@ -2,6 +2,7 @@ flush query cache;
flush query cache;
reset query cache;
flush status;
drop database if exists mysqltest;
drop table if exists t1,t2,t3,t11,t21, mysqltest.t1;
create table t1 (a int not null);
insert into t1 values (1),(2),(3);
......
......@@ -37,3 +37,5 @@ select * from t3;
3 table 3
3 table 3
drop table if exists t1,t2,t3,t4;
Warnings:
Note 1051 Unknown table 't4'
drop table if exists t1;
select row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3));
row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3))
1
......@@ -88,7 +89,6 @@ ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL))
NULL
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4);
Cardinality error (more/less than 2 columns)
drop table if exists t1;
create table t1 ( a int, b int, c int);
insert into t1 values (1,2,3), (2,3,1), (3,2,1), (1,2,NULL);
select * from t1 where ROW(1,2,3)=ROW(a,b,c);
......@@ -127,7 +127,6 @@ ROW(1,2,3) IN(row(a,b,c), row(1,2,3))
drop table t1;
select ROW(1,1);
Cardinality error (more/less than 1 columns)
drop table if exists t1;
create table t1 (i int);
select 1 from t1 where ROW(1,1);
Cardinality error (more/less than 1 columns)
......
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1,t2,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/std_data/words.dat' into table t1;
......
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
......@@ -18,7 +17,6 @@ Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 9999 2 1
drop table t1;
stop slave;
drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345;
insert into t2 set created=now();
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
create table t1(n int primary key);
insert into t1 values (1),(2),(2);
Duplicate entry '2' for key 1
insert into t1 values (3);
select * from t1;
n
1
2
3
drop table t1;
......@@ -5,18 +5,13 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1 (word char(20) not null, index(word));
load data infile '../../std_data/words.dat' into table t1;
drop table if exists t2;
create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key);
drop table if exists t1;
load table t1 from master;
drop table if exists t2;
load table t2 from master;
drop table if exists t3;
load table t3 from master;
check table t1;
Table Op Msg_type Msg_text
......
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
CREATE TABLE t1 (name varchar(64), age smallint(3));
INSERT INTO t1 SET name='Andy', age=31;
INSERT t1 SET name='Jacob', age=2;
......
......@@ -5,13 +5,11 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
set SQL_LOG_BIN=0,timestamp=200006;
drop table if exists t1;
create table t1(t timestamp not null,a char(1));
insert into t1 ( a) values ('F');
select unix_timestamp(t) from t1;
unix_timestamp(t)
200006
drop table if exists t1;
load table t1 from master;
select unix_timestamp(t) from t1;
unix_timestamp(t)
......
......@@ -5,21 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
use test;
drop table if exists foo;
create table foo (n int);
insert into foo values(4);
drop table if exists mysqltest_foo;
drop table if exists mysqltest_bar;
create table mysqltest_foo (n int);
insert into mysqltest_foo values(4);
use test;
drop table if exists foo;
create table foo (n int);
insert into foo values(5);
drop table if exists bar;
create table bar (m int);
insert into bar values(15);
drop table if exists choo;
create table choo (k int);
insert into choo values(55);
select foo.n,bar.m,choo.k from foo,bar,choo;
create table mysqltest_foo (n int);
insert into mysqltest_foo values(5);
create table mysqltest_bar (m int);
insert into mysqltest_bar values(15);
create table t1 (k int);
insert into t1 values(55);
select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1;
n m k
4 15 55
drop table if exists foo,bar,choo;
drop table if exists foo,bar,choo;
drop table mysqltest_foo,mysqltest_bar,t1;
drop table mysqltest_foo,mysqltest_bar,t1;
......@@ -4,80 +4,78 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists foo;
create database foo;
drop database if exists bar;
create database bar;
drop table if exists foo.foo;
create table foo.foo (n int);
insert into foo.foo values(4);
drop table if exists foo.foo;
create table foo.foo (n int);
insert into foo.foo values(5);
drop table if exists bar.bar;
create table bar.bar (m int);
insert into bar.bar values(15);
select foo.foo.n,bar.bar.m from foo.foo,bar.bar;
drop database if exists mysqltest2;
create database mysqltest2;
drop database if exists mysqltest;
create database mysqltest;
create table mysqltest2.foo (n int);
insert into mysqltest2.foo values(4);
create table mysqltest2.foo (n int);
insert into mysqltest2.foo values(5);
create table mysqltest.bar (m int);
insert into mysqltest.bar values(15);
select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.bar;
n m
4 15
drop database if exists bar;
drop database if exists foo;
drop database if exists bar;
drop database if exists foo;
drop database mysqltest;
drop database mysqltest2;
set sql_log_bin = 0;
create database foo;
create database bar;
create database mysqltest2;
create database mysqltest;
show databases;
Database
bar
foo
mysql
mysqltest
mysqltest2
test
create table foo.t1(n int, s char(20));
create table foo.t2(n int, s text);
insert into foo.t1 values (1, 'one'), (2, 'two'), (3, 'three');
insert into foo.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen');
create table bar.t1(n int, s char(20));
create table bar.t2(n int, s text);
insert into bar.t1 values (1, 'one bar'), (2, 'two bar'), (3, 'three bar');
insert into bar.t2 values (11, 'eleven bar'), (12, 'twelve bar'),
(13, 'thirteen bar');
create table mysqltest2.t1(n int, s char(20));
create table mysqltest2.t2(n int, s text);
insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three');
insert into mysqltest2.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen');
create table mysqltest.t1(n int, s char(20));
create table mysqltest.t2(n int, s text);
insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three test');
insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'),
(13, 'thirteen test');
set sql_log_bin = 1;
show databases;
Database
mysql
test
load data from master;
Warnings:
Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
Note 1008 Can't drop database 'mysqltest2'. Database doesn't exist
show databases;
Database
bar
foo
mysql
mysqltest
mysqltest2
test
use foo;
use mysqltest2;
show tables;
Tables_in_foo
use bar;
Tables_in_mysqltest2
use mysqltest;
show tables;
Tables_in_bar
Tables_in_mysqltest
t1
t2
select * from bar.t1;
select * from mysqltest.t1;
n s
1 one bar
2 two bar
3 three bar
select * from bar.t2;
1 one test
2 two test
3 three test
select * from mysqltest.t2;
n s
11 eleven bar
12 twelve bar
13 thirteen bar
insert into bar.t1 values (4, 'four bar');
select * from bar.t1;
11 eleven test
12 twelve test
13 thirteen test
insert into mysqltest.t1 values (4, 'four test');
select * from mysqltest.t1;
n s
1 one bar
2 two bar
3 three bar
4 four bar
drop database bar;
drop database foo;
1 one test
2 two test
3 three test
4 four test
drop database mysqltest;
drop database mysqltest2;
......@@ -4,8 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
drop table if exists t1;
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
......
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
create table t1 (n int);
insert into t1 values(1);
stop slave;
......
......@@ -4,18 +4,16 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1,t2,t3;
create table t2 (n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
insert into t2 select * from t1;
drop table if exists test.t3;
create temporary table test.t3 (n int not null);
alter table test.t3 add primary key(n);
create temporary table t3 (n int not null);
alter table t3 add primary key(n);
flush logs;
insert into t3 values (100);
insert into t2 select * from t3;
drop table if exists test.t3;
drop table if exists t3;
insert into t2 values (101);
create temporary table t1 (n int);
insert into t1 values (4),(5);
......@@ -35,3 +33,5 @@ show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t2;
create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
......@@ -25,3 +24,5 @@ show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
......@@ -4,18 +4,18 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists d1;
create database d1;
create table d1.t1 ( n int);
alter table d1.t1 add m int;
insert into d1.t1 values (1,2);
create table d1.t2 (n int);
insert into d1.t2 values (45);
rename table d1.t2 to d1.t3, d1.t1 to d1.t2;
select * from d1.t2;
drop database if exists test_$1;
create database test_$1;
create table test_$1.t1 ( n int);
alter table test_$1.t1 add m int;
insert into test_$1.t1 values (1,2);
create table test_$1.t2 (n int);
insert into test_$1.t2 values (45);
rename table test_$1.t2 to test_$1.t3, test_$1.t1 to test_$1.t2;
select * from test_$1.t2;
n m
1 2
select * from d1.t3;
select * from test_$1.t3;
n
45
drop database d1;
drop database test_$1;
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
load table t1 from master;
......
......@@ -9,7 +9,6 @@ Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Lo
SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 2 1
drop table if exists t1;
create table t1 ( n int);
insert into t1 values (1),(2),(3),(4);
insert into t1 values(5);
......
......@@ -25,4 +25,4 @@ n
4
select * from t11;
Table 'test.t11' doesn't exist
drop table if exists t1,t2,t3,t11;
drop table if exists t1,t2,t11;
......@@ -22,7 +22,6 @@ s
Could not break slave
Tried hard
flush logs;
drop table if exists t2;
create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
flush logs;
......@@ -58,7 +57,6 @@ m
1234
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3;
create table t3 (n int);
create table t4 select * from temp_table;
show binary logs;
......
......@@ -4,7 +4,6 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
create table t1 (n int not null primary key);
insert into t1 values (1);
insert into t1 values (1);
......
......@@ -4,9 +4,8 @@ reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
drop table if exists t1,t2;
create table t1(f int);
drop table if exists t2;
create table t2(f int);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
create temporary table t3(f int);
......@@ -35,8 +34,7 @@ master-bin.000001 573 Query 1 573 use `test`; insert into t3 select * from t1 wh
master-bin.000001 650 Query 1 650 use `test`; drop temporary table t3
master-bin.000001 708 Query 1 708 use `test`; insert into t2 select count(*) from t3
master-bin.000001 781 Query 1 781 use `test`; drop temporary table t3
drop table if exists t1;
drop table if exists t2;
drop table t1, t2;
use test;
SET TIMESTAMP=1040323920;
create table t1(f int);
......@@ -72,3 +70,4 @@ select * from t2;
f
5
7
drop table t1,t2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (s CHAR(20) PRIMARY KEY, id INT);
INSERT INTO t1 VALUES ('cat', 1), ('mouse', 3), ('dog', 2), ('snake', 77);
SELECT s, id FROM t1 WHERE s = 'mouse';
s id
mouse 3
drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1), (2), (3);
SELECT * FROM t1;
n
1
2
3
drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score));
INSERT INTO t1 VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10);
SELECT COUNT(*) as n, score FROM t1 GROUP BY score;
n score
4 10
2 20
drop table t1;
drop table if exists t1,t2;
create table t1 (id int(10) not null unique);
create table t2 (id int(10) not null primary key,
val int(10) not null);
insert into t1 values (1),(2),(4);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id order by one.id;
id elt(two.val,'one','two')
1 one
2 one
4 two
drop table t1,t2;
drop table if exists t1,t2;
create table t1 (id int(10) not null unique);
create table t2 (id int(10) not null primary key,
val int(10) not null);
insert into t1 values (1),(2),(4);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
id elt(two.val,'one','two')
1 one
2 one
4 two
drop table t1,t2;
use test;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
......@@ -2493,7 +2492,6 @@ fld1 fld3 period price price2
018601 vacuuming 1001 5987435 234724
018801 inch 1001 5987435 234724
018811 repetitions 1001 5987435 234724
drop table if exists company;
create table t4 (
companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
......@@ -3478,7 +3476,6 @@ a a a
2 2 2
3 3 3
drop table t1;
drop table if exists t1,t2;
CREATE TABLE t1 ( aa char(2), id int(11) NOT NULL auto_increment, t2_id int(11) NOT NULL default '0', PRIMARY KEY (id), KEY replace_id (t2_id)) TYPE=MyISAM;
INSERT INTO t1 VALUES ("1",8264,2506),("2",8299,2517),("3",8301,2518),("4",8302,2519),("5",8303,2520),("6",8304,2521),("7",8305,2522);
CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM;
......@@ -3490,4 +3487,4 @@ aa id t2_id id
4 8302 2519 2519
5 8303 2520 2520
6 8304 2521 2521
drop table if exists t1,t2;
drop table t1,t2;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
select (select 2);
(select 2)
2
......@@ -119,7 +120,6 @@ SELECT (SELECT 1.5,2,'a') = ROW(1.5,'c','a');
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
create table t1 (a int);
create table t2 (a int, b int);
create table t3 (a int);
......@@ -310,7 +310,6 @@ W 1
SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3);
a b
W a
drop table if exists t8;
CREATE TABLE `t8` (
`pseudo` varchar(35) character set latin1 NOT NULL default '',
`email` varchar(60) character set latin1 NOT NULL default '',
......@@ -520,7 +519,6 @@ a b
0 10
1 11
drop table t1, t2;
drop table if exists t11, t12, t2;
create table t11 (a int NOT NULL, b int, primary key (a));
create table t12 (a int NOT NULL, b int, primary key (a));
create table t2 (a int NOT NULL, b int, primary key (a));
......@@ -626,7 +624,6 @@ x y
drop table t1, t2, t3;
SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *);
No tables used
drop table if exists t;
CREATE TABLE t (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1;
INSERT INTO t VALUES (1),(2);
SELECT * FROM t WHERE id IN (SELECT 1);
......@@ -809,45 +806,44 @@ a (select a,b,c from t1 where t1.a=t2.a) = ROW(a,4,'c') (select c from t1 where
2 0 b
NULL NULL NULL
drop table t1,t2;
drop table if exists t;
create table t (a int, b real, c varchar(10));
insert into t values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
select ROW(1, 1, 'a') IN (select a,b,c from t);
ROW(1, 1, 'a') IN (select a,b,c from t)
1
select ROW(1, 2, 'a') IN (select a,b,c from t);
ROW(1, 2, 'a') IN (select a,b,c from t)
create table t1 (a int, b real, c varchar(10));
insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
select ROW(1, 1, 'a') IN (select a,b,c from t1);
ROW(1, 1, 'a') IN (select a,b,c from t1)
1
select ROW(1, 2, 'a') IN (select a,b,c from t1);
ROW(1, 2, 'a') IN (select a,b,c from t1)
NULL
select ROW(1, 1, 'a') IN (select b,a,c from t);
ROW(1, 1, 'a') IN (select b,a,c from t)
select ROW(1, 1, 'a') IN (select b,a,c from t1);
ROW(1, 1, 'a') IN (select b,a,c from t1)
1
select ROW(1, 1, 'a') IN (select a,b,c from t where a is not null);
ROW(1, 1, 'a') IN (select a,b,c from t where a is not null)
select ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null);
ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null)
1
select ROW(1, 2, 'a') IN (select a,b,c from t where a is not null);
ROW(1, 2, 'a') IN (select a,b,c from t where a is not null)
select ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null);
ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null)
0
select ROW(1, 1, 'a') IN (select b,a,c from t where a is not null);
ROW(1, 1, 'a') IN (select b,a,c from t where a is not null)
select ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null);
ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null)
1
select ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a');
ROW(1, 1, 'a') IN (select a,b,c from t where c='b' or c='a')
select ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a');
ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a')
1
select ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a');
ROW(1, 2, 'a') IN (select a,b,c from t where c='b' or c='a')
select ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a');
ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a')
NULL
select ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a');
ROW(1, 1, 'a') IN (select b,a,c from t where c='b' or c='a')
select ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a');
ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a')
1
select ROW(1, 1, 'a') IN (select b,a,c from t limit 2);
select ROW(1, 1, 'a') IN (select b,a,c from t1 limit 2);
This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t;
create table t (a int);
insert into t values (1);
do @a:=(SELECT a from t);
drop table t1;
create table t1 (a int);
insert into t1 values (1);
do @a:=(SELECT a from t1);
select @a;
@a
1
drop table t;
do (SELECT a from t);
Table 'test.t' doesn't exist
drop table t1;
do (SELECT a from t1);
Table 'test.t1' doesn't exist
......@@ -48,7 +48,6 @@ c d e
3 b 2
drop table t1;
drop table t1;
drop table if exists t1;
CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255));
INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1');
SELECT CONCAT_WS(pkCrash, strCrash) FROM t1;
......@@ -77,7 +76,6 @@ insert into t1 values (1),(1);
alter table t1 add primary key (a);
Duplicate entry '1' for key 1
drop table t1;
drop table if exists t1;
CREATE TABLE t1 (
d datetime default NULL
) TYPE=MyISAM;
......
drop table if exists t1,t2;
create table t1 (a char(16), b date, c datetime);
insert into t1 SET a='test 2000-01-01', b='2000-01-01', c='2000-01-01';
select * from t1 where c = '2000-01-01';
......@@ -7,7 +8,6 @@ select * from t1 where b = '2000-01-01';
a b c
test 2000-01-01 2000-01-01 2000-01-01 00:00:00
drop table t1;
drop table if exists t1,t2;
CREATE TABLE t1 (name char(6),cdate date);
INSERT INTO t1 VALUES ('name1','1998-01-01');
INSERT INTO t1 VALUES ('name2','1998-01-01');
......
drop table if exists t1;
SELECT 10,10.0,10.,.1e+2,100.0e-1;
10 10.0 10. .1e+2 100.0e-1
10 10.0 10 10 10
......@@ -7,7 +8,6 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1
10 10 10 10 10 10 0.1 0.1 0.1
drop table if exists t1;
create table t1 (f1 float(24),f2 float(52));
show full columns from t1;
Field Type Null Key Default Extra Privileges Comment
......
......@@ -170,7 +170,6 @@ testtt
tsestset
1
drop table t1;
drop table if exists t1,t2;
create table t1 (a int);
create table t2 (a int);
insert into t1 values (1),(2),(3),(4),(5);
......
drop table if exists t1;
drop table if exists t1,t2;
create table t1 (a int auto_increment , primary key (a));
insert into t1 values (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
update t1 set a=a+10 where a > 34;
......
drop table if exists t1,t2;
set @a := foo;
Unknown column 'foo' in 'field list'
set @a := connection_id() + 3;
select @a - connection_id();
@a - connection_id()
3
drop table if exists t1,t2;
CREATE TABLE t1 ( i int not null, v int not null,index (i));
insert into t1 values (1,1),(1,3),(2,1);
create table t2 (i int not null, unique (i));
......
drop table if exists t1;
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ;
0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0
A 65 9223372036854775807 18446744073709551615
......@@ -7,7 +8,6 @@ select 0x31+1,concat(0x31)+1,-0xf;
select x'31',X'ffff'+0;
x'31' X'ffff'+0
1 65535
drop table if exists t1;
create table t1 (ID int(8) unsigned zerofill not null auto_increment,UNIQ bigint(21) unsigned zerofill not null,primary key (ID),unique (UNIQ) );
insert into t1 set UNIQ=0x38afba1d73e6a18a;
insert into t1 set UNIQ=123;
......
drop table if exists t1;
drop table if exists t1,t2;
set @`test`=1,@TEST=3,@select=2,@t5=1.23456;
select @test,@`select`,@TEST,@not_used;
@test @`select` @TEST @not_used
......@@ -315,7 +315,6 @@ set tmp_table_size=100;
set tx_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;
DROP TABLE IF EXISTS t1,t2;
create table t1 (a int not null auto_increment, primary key(a));
create table t2 (a int not null auto_increment, primary key(a));
insert into t1 values(null),(null),(null);
......
drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (a int);
insert into t1 values (1);
insert into t1 values ("hej");
......@@ -8,3 +10,6 @@ insert into t1 values ("hej");
insert into t1 values ("hej"),("d");
drop table t1;
set SQL_WARNINGS=0;
drop temporary table if exists not_exists;
Warnings:
Note 1051 Unknown table 'not_exists'
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (
cont_nr int(11) NOT NULL auto_increment,
ver_nr int(11) NOT NULL default '0',
......
#
# Test of alter table
#
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
......
......@@ -2,7 +2,9 @@
# Test of procedure analyse
#
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (i int, j int);
insert into t1 values (1,2), (3,4), (5,6), (7,8);
select * from t1 procedure analyse();
......@@ -10,4 +12,4 @@ create table t2 select * from t1 procedure analyse();
select * from t2;
drop table t1,t2;
EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE();
\ No newline at end of file
EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE();
#
# Test of auto_increment; The test for BDB tables is in bdb.test
#
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int not null auto_increment,b int, primary key (a)) type=myisam auto_increment=3;
insert into t1 values (1,1),(NULL,3),(NULL,4);
delete from t1 where a=4;
......
......@@ -2,7 +2,9 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
set SQL_LOG_BIN=0;
drop table if exists t1;
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
create table t1(n int);
--replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X"
backup table t1 to '../bogus';
......
......@@ -2,7 +2,10 @@
# Test of problem when shutting down mysqld at once after ALTER TABLE
#
-- source include/have_bdb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) type=BDB;
insert into t1 values(1, 't1',4,9);
insert into t1 values(2, 'metatable',1,9);
......
......@@ -2,7 +2,9 @@
# test for bug reported by Mark Steele
--disable_warnings
drop table if exists t1;
--enable_warnings
CREATE TABLE t1 (
ChargeID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
......
......@@ -11,7 +11,9 @@
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
connection con1;
create table t1 (id integer, x integer) type=BDB;
create table t2 (id integer, x integer) type=BDB;
......
......@@ -4,7 +4,9 @@
# Small basic test with ignore
#
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
--enable_warnings
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=bdb;
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
......@@ -441,7 +443,6 @@ drop table t1;
# This gave a wrong result because the row information was freed too early
#
drop table if exists t1, t2, t3, t4, t5, t6, t7;
create table t1
(
branch_id int auto_increment primary key,
......@@ -451,7 +452,6 @@ create table t1
unique branch_name(branch_name),
index branch_active(branch_active)
) type=bdb;
drop table if exists t2 ;
create table t2
(
target_id int auto_increment primary key,
......@@ -461,7 +461,6 @@ create table t2
unique target_name(target_name),
index target_active(target_active)
) type=bdb;
drop table if exists t3 ;
create table t3
(
platform_id int auto_increment primary key,
......@@ -471,7 +470,6 @@ create table t3
unique platform_name(platform_name),
index platform_active(platform_active)
) type=bdb;
drop table if exists t4 ;
create table t4
(
product_id int auto_increment primary key,
......@@ -482,7 +480,6 @@ create table t4
unique product_name(product_name),
index product_active(product_active)
) type=bdb;
drop table if exists t5 ;
create table t5
(
product_file_id int auto_increment primary key,
......@@ -496,7 +493,6 @@ create table t5
unique product_file(product_id,file_name),
index file_included(file_included)
) type=bdb;
drop table if exists t6 ;
create table t6
(
file_platform_id int auto_increment primary key,
......@@ -510,7 +506,6 @@ create table t6
unique file_platform(product_file_id,platform_id,branch_id)
) type=bdb;
drop table if exists t8 ;
create table t8
(
archive_id int auto_increment primary key,
......@@ -523,7 +518,6 @@ create table t8
unique archive(branch_id,target_id,platform_id,product_id),
index status_id(status_id)
) type=bdb;
drop table if exists t7 ;
create table t7
(
build_id int auto_increment primary key,
......@@ -727,7 +721,6 @@ DROP TABLE t1,t2;
# Test problem with joining table to itself on a multi-part unique key
#
drop table if exists t1;
create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
insert into t1 values (1,1), (1,2);
select * from t1 where a = 1;
......
......@@ -4,7 +4,9 @@
#
# Without auto_commit.
#
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
flush status;
set autocommit=0;
create table t1 (a int not null) type=bdb;
......
#
# Test of count(distinct ..)
#
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(n int not null, key(n)) delay_key_write = 1;
let $1=100;
disable_query_log;
......
#
# Initialize
--disable_warnings
drop table if exists t1;
--enable_warnings
#
# Test of reading of bigint values
#
......@@ -11,7 +18,6 @@ select +9999999999999999999,-9999999999999999999;
# This will work on 4.0 as we then have internal handling of bigint variables.
#
drop table if exists t1;
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1;
......
#
# test sort,min and max on binary fields
#
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (name char(20) not null, primary key (name));
create table t2 (name char(20) binary not null, primary key (name));
insert into t1 values ("");
......
......@@ -2,7 +2,9 @@
# Test of boolean operations with NULL
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
SELECT IF(NULL AND 1, 1, 2), IF(1 AND NULL, 1, 2);
SELECT NULL AND 1, 1 AND NULL, 0 AND NULL, NULL and 0;
......@@ -33,19 +35,17 @@ DROP TABLE t1;
# Read nA as !A, AB as A && B, AoB as A || B
# Result table makes ANSI happy
drop table if exists t;
create table t(a int, b int);
insert into t values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
create table t1 (a int, b int);
insert into t1 values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
# Below test is valid untill we have True/False implemented as 1/0
# To comply to all rules it must show that: n(AB) = nAonB, n(AoB) = nAnB
select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t;
select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A or not B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A and not B, 'N') as nAnB from t1;
# This should work with any internal representation of True/False
# Result must be same as above
select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t;
select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) or not (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) and not (B=1), 'N') as nAnB from t1;
drop table t;
drop table t1;
#
# this is a test of bulk-insert code
# as used by REPLACE
#
# by Monty
#
--disable_warnings
drop table if exists t1;
--enable_warnings
CREATE TABLE t1 (a int, unique (a), b int not null, unique(b), c int not null, index(c));
replace into t1 values (1,1,1),(2,2,2),(3,1,3);
select * from t1;
......
......@@ -2,7 +2,9 @@
# Testing of CASE
#
--disable_warnings
drop table if exists t1;
--enable_warnings
select CASE "b" when "a" then 1 when "b" then 2 END;
select CASE "c" when "a" then 1 when "b" then 2 END;
......
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
--disable_warnings
drop table if exists t1;
#add a lot of keys to slow down check
--enable_warnings
# Add a lot of keys to slow down check
create table t1(n int not null, key(n), key(n), key(n), key(n));
let $1=10000;
disable_query_log;
......
......@@ -2,7 +2,10 @@
# Bug when using comparions of strings and integers.
#
--disable_warnings
drop table if exists t1;
--enable_warnings
CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id));
insert into t1 values ('000000000001'),('000000000002');
explain select * from t1 where id=000000000001;
......
......@@ -41,7 +41,6 @@ show tables;
#--error 1045
# check if old password version also works
update mysql.user set password=old_password("gambling2") where user="test";
flush privileges;
......
......@@ -2,7 +2,9 @@
# Testing of constraints
# Currently MySQL only ignores the syntax.
#
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int check (a>0));
insert into t1 values (1);
......
......@@ -2,7 +2,10 @@
# Problem with count(distinct)
#
--disable_warnings
drop table if exists t1,t2,t3;
--enable_warnings
create table t1 (libname varchar(21) not null, city text, primary key (libname));
create table t2 (isbn varchar(21) not null, author text, title text, primary key (isbn));
create table t3 (isbn varchar(21) not null, libname varchar(21) not null, quantity int ,primary key (isbn,libname));
......
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text);
insert into t1 values (1,11, 'one','eleven', 'eleven'),
......
......@@ -2,7 +2,10 @@
# Check some special create statements.
#
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (b char(0));
insert into t1 values (""),(null);
select * from t1;
......@@ -12,7 +15,7 @@ create table t1 (b char(0) not null);
create table if not exists t1 (b char(0) not null);
insert into t1 values (""),(null);
select * from t1;
drop table if exists t1;
drop table t1;
#
# Test of some CREATE TABLE'S that should fail
......@@ -91,11 +94,14 @@ create table t2 (a int) select * from t1;
describe t1;
describe t2;
drop table if exists t2;
!$1060 create table t2 (a int, a float) select * from t1;
--error 1060
create table t2 (a int, a float) select * from t1;
drop table if exists t2;
!$1060 create table t2 (a int) select a as b, a+1 as b from t1;
--error 1060
create table t2 (a int) select a as b, a+1 as b from t1;
drop table if exists t2;
!$1060 create table t2 (b int) select a as b, a+1 as b from t1;
--error 1060
create table t2 (b int) select a as b, a+1 as b from t1;
drop table if exists t1,t2;
#
......@@ -118,7 +124,6 @@ drop table if exists t1,t2;
# Test for CREATE TABLE .. LIKE ..
#
drop table if exists t1, t2, t3;
create table t1(id int not null, name char(20));
insert into t1 values(10,'mysql'),(20,'monty- the creator');
create table t2(id int not null);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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