Commit 1f6ecc0c authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

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()
parent f9772317
...@@ -389,9 +389,11 @@ int main(int argc,char *argv[]) ...@@ -389,9 +389,11 @@ int main(int argc,char *argv[])
} }
} }
#endif #endif
sprintf(buff, "%s%s", sprintf(buff, "%s",
"Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n", "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"); "Type 'help [[%]function name[%]]' to get help on usage of function.\n");
#endif
put_info(buff,INFO_INFO); put_info(buff,INFO_INFO);
status.exit_status=read_lines(1); // read lines and execute them status.exit_status=read_lines(1); // read lines and execute them
if (opt_outfile) if (opt_outfile)
...@@ -663,7 +665,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -663,7 +665,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_nopager= 1; opt_nopager= 1;
case OPT_MYSQL_PROTOCOL: 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); fprintf(stderr, "Unknown option to protocol: %s\n", argument);
exit(1); exit(1);
...@@ -1299,7 +1302,7 @@ You can turn off this feature to get a quicker startup with -A\n\n"); ...@@ -1299,7 +1302,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
sizeof(char *) * sizeof(char *) *
(num_fields*2+1)))) (num_fields*2+1))))
break; break;
field_names[i][num_fields*2]='\0'; field_names[i][num_fields*2]= '\0';
j=0; j=0;
while ((sql_field=mysql_fetch_field(fields))) 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"); ...@@ -1319,7 +1322,7 @@ You can turn off this feature to get a quicker startup with -A\n\n");
{ {
tee_fprintf(stdout, tee_fprintf(stdout,
"Didn't find any fields in table '%s'\n",table_row[0]); "Didn't find any fields in table '%s'\n",table_row[0]);
field_names[i]=0; field_names[i]= 0;
} }
i++; i++;
} }
...@@ -1407,17 +1410,15 @@ static int com_server_help(String *buffer __attribute__((unused)), ...@@ -1407,17 +1410,15 @@ static int com_server_help(String *buffer __attribute__((unused)),
MYSQL_ROW cur; MYSQL_ROW cur;
const char *server_cmd= buffer->ptr(); const char *server_cmd= buffer->ptr();
char cmd_buf[100]; 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; server_cmd= cmd_buf;
} }
MYSQL_RES *result;
ulong timer;
uint error= 0;
if (!status.batch) if (!status.batch)
{ {
old_buffer= *buffer; old_buffer= *buffer;
...@@ -1427,26 +1428,24 @@ static int com_server_help(String *buffer __attribute__((unused)), ...@@ -1427,26 +1428,24 @@ static int com_server_help(String *buffer __attribute__((unused)),
if (!connected && reconnect()) if (!connected && reconnect())
return 1; return 1;
timer= start_timer(); if ((error= mysql_real_query_for_lazy(server_cmd,strlen(server_cmd))))
error= mysql_real_query_for_lazy(server_cmd,strlen(server_cmd));
if (error)
return error; return error;
if ((error= mysql_store_result_for_lazy(&result)))
error= mysql_store_result_for_lazy(&result);
if (error)
return error; return error;
if (result) if (result)
{ {
int num_rows= mysql_num_rows(result); int num_rows= mysql_num_rows(result);
if (num_rows==1) if (num_rows == 1)
{ {
if (!(cur= mysql_fetch_row(result))) if (!(cur= mysql_fetch_row(result)))
return -1; {
error= -1;
goto err;
}
init_pager(); init_pager();
if (cur[1][0]=='Y') if (cur[1][0] == 'Y')
{ {
tee_fprintf(PAGER, "\nHelp topic \'%s\'\n", cur[0]); tee_fprintf(PAGER, "\nHelp topic \'%s\'\n", cur[0]);
tee_fprintf(PAGER, "%s\n", cur[2]); tee_fprintf(PAGER, "%s\n", cur[2]);
...@@ -1460,17 +1459,19 @@ static int com_server_help(String *buffer __attribute__((unused)), ...@@ -1460,17 +1459,19 @@ static int com_server_help(String *buffer __attribute__((unused)),
} }
end_pager(); 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("\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); put_info("For more specific request please type 'help <item>' where item is one of next :", INFO_INFO);
init_pager(); init_pager();
char last_char= '_'; char last_char= '_';
while ((cur= mysql_fetch_row(result))){ while ((cur= mysql_fetch_row(result)))
if (cur[1][0]!=last_char){ {
if (cur[1][0]!=last_char)
{
put_info("-------------------------------------------", INFO_INFO); put_info("-------------------------------------------", INFO_INFO);
put_info(cur[1][0]=='Y' ? put_info(cur[1][0] == 'Y' ?
"categories:" : "functions:", INFO_INFO); "categories:" : "functions:", INFO_INFO);
put_info("-------------------------------------------", INFO_INFO); put_info("-------------------------------------------", INFO_INFO);
} }
...@@ -1486,6 +1487,7 @@ static int com_server_help(String *buffer __attribute__((unused)), ...@@ -1486,6 +1487,7 @@ static int com_server_help(String *buffer __attribute__((unused)),
} }
} }
err:
mysql_free_result(result); mysql_free_result(result);
return error; return error;
} }
......
...@@ -166,7 +166,8 @@ typedef struct ...@@ -166,7 +166,8 @@ typedef struct
VAR var_reg[10]; VAR var_reg[10];
/*Perl/shell-like variable registers */ /*Perl/shell-like variable registers */
HASH var_hash; 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 cons[MAX_CONS];
struct connection* cur_con, *next_con, *cons_end; struct connection* cur_con, *next_con, *cons_end;
...@@ -195,6 +196,8 @@ Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG, ...@@ -195,6 +196,8 @@ Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER, Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER,
Q_WAIT_FOR_SLAVE_TO_STOP, Q_WAIT_FOR_SLAVE_TO_STOP,
Q_REQUIRE_VERSION, Q_REQUIRE_VERSION,
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
Q_ENABLE_INFO, Q_DISABLE_INFO,
Q_UNKNOWN, /* Unknown command. */ Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */ Q_COMMENT, /* Comments, ignored. */
Q_COMMENT_WITH_COMMAND Q_COMMENT_WITH_COMMAND
...@@ -253,6 +256,10 @@ const char *command_names[]= ...@@ -253,6 +256,10 @@ const char *command_names[]=
"require_manager", "require_manager",
"wait_for_slave_to_stop", "wait_for_slave_to_stop",
"require_version", "require_version",
"enable_warnings",
"disable_warnings",
"enable_info",
"diable_info",
0 0
}; };
...@@ -2169,17 +2176,17 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) ...@@ -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), verbose_msg("query '%s' failed: %d: %s", q->query, mysql_errno(mysql),
mysql_error(mysql)); mysql_error(mysql));
/* /*
if we do not abort on error, failure to run the query does if we do not abort on error, failure to run the query does
not fail the whole test case not fail the whole test case
*/ */
goto end; goto end;
} }
/*{ /*{
verbose_msg("failed in mysql_store_result for query '%s' (%d)", query, verbose_msg("failed in mysql_store_result for query '%s' (%d)", query,
mysql_errno(mysql)); mysql_errno(mysql));
error = 1; error = 1;
goto end; goto end;
}*/ }*/
} }
if (q->expected_errno[0]) if (q->expected_errno[0])
...@@ -2190,39 +2197,49 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) ...@@ -2190,39 +2197,49 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
goto end; goto end;
} }
if (!disable_result_log && res) if (!disable_result_log)
{ {
int num_fields= mysql_num_fields(res); if (res)
MYSQL_FIELD *fields= mysql_fetch_fields(res);
for (i = 0; i < num_fields; i++)
{ {
if (i) int num_fields= mysql_num_fields(res);
dynstr_append_mem(ds, "\t", 1); MYSQL_FIELD *fields= mysql_fetch_fields(res);
dynstr_append(ds, fields[i].name); 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 */ /* Add all warnings to the result */
if (!disable_result_log && mysql_warning_count(mysql)) if (!disable_warnings && mysql_warning_count(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); 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) if (!disable_info && mysql_info(mysql))
verbose_msg("Warning count is %u but didn't get any warnings\n",
count);
else
{ {
dynstr_append_mem(ds, "Warnings:\n", 10); dynstr_append(ds, "info: ");
append_result(ds, warn_res); dynstr_append(ds, mysql_info(mysql));
mysql_free_result(warn_res); dynstr_append_mem(ds, "\n", 1);
} }
} }
if (glob_replace) if (glob_replace)
free_replace(); free_replace();
...@@ -2431,6 +2448,10 @@ int main(int argc, char** argv) ...@@ -2431,6 +2448,10 @@ int main(int argc, char** argv)
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break; case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break; case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
case Q_DISABLE_RESULT_LOG: disable_result_log=1; 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_SOURCE: do_source(q); break;
case Q_SLEEP: do_sleep(q, 0); break; case Q_SLEEP: do_sleep(q, 0); break;
case Q_REAL_SLEEP: do_sleep(q, 1); break; case Q_REAL_SLEEP: do_sleep(q, 1); break;
......
...@@ -10,7 +10,7 @@ AM_CONFIG_HEADER(config.h) ...@@ -10,7 +10,7 @@ AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
DOT_FRM_VERSION=6 DOT_FRM_VERSION=6
# See the libtool docs for information on how to do shared lib versions. # 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 ? # 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 # Remember that regexps needs to quote [ and ] since this is run through m4
......
...@@ -7,12 +7,16 @@ connection slave; ...@@ -7,12 +7,16 @@ connection slave;
!stop slave; !stop slave;
@r/slave-stopped.result show status like 'Slave_running'; @r/slave-stopped.result show status like 'Slave_running';
connection master; connection master;
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
reset master; reset master;
connection slave; connection slave;
reset slave; reset slave;
# Clean up old test tables # Clean up old test tables
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
start slave; start slave;
@r/slave-running.result show status like 'Slave_running'; @r/slave-running.result show status like 'Slave_running';
......
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
drop table if exists t1; drop table if exists t1, t2, t3;
create table t1(n int); create table t1(n int);
backup table t1 to '../bogus'; backup table t1 to '../bogus';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
......
...@@ -797,7 +797,6 @@ select * from t1 where i=1 and j=2; ...@@ -797,7 +797,6 @@ select * from t1 where i=1 and j=2;
i j i j
1 2 1 2
drop table t1; drop table t1;
drop table if exists t1, t2, t3, t4, t5, t6, t7;
create table t1 create table t1
( (
branch_id int auto_increment primary key, branch_id int auto_increment primary key,
...@@ -806,7 +805,6 @@ branch_active int not null default 1, ...@@ -806,7 +805,6 @@ branch_active int not null default 1,
unique branch_name(branch_name), unique branch_name(branch_name),
index branch_active(branch_active) index branch_active(branch_active)
) type=bdb; ) type=bdb;
drop table if exists t2 ;
create table t2 create table t2
( (
target_id int auto_increment primary key, target_id int auto_increment primary key,
...@@ -815,7 +813,6 @@ target_active int not null default 1, ...@@ -815,7 +813,6 @@ target_active int not null default 1,
unique target_name(target_name), unique target_name(target_name),
index target_active(target_active) index target_active(target_active)
) type=bdb; ) type=bdb;
drop table if exists t3 ;
create table t3 create table t3
( (
platform_id int auto_increment primary key, platform_id int auto_increment primary key,
...@@ -824,7 +821,6 @@ platform_active int not null default 1, ...@@ -824,7 +821,6 @@ platform_active int not null default 1,
unique platform_name(platform_name), unique platform_name(platform_name),
index platform_active(platform_active) index platform_active(platform_active)
) type=bdb; ) type=bdb;
drop table if exists t4 ;
create table t4 create table t4
( (
product_id int auto_increment primary key, product_id int auto_increment primary key,
...@@ -834,7 +830,6 @@ product_active int not null default 1, ...@@ -834,7 +830,6 @@ product_active int not null default 1,
unique product_name(product_name), unique product_name(product_name),
index product_active(product_active) index product_active(product_active)
) type=bdb; ) type=bdb;
drop table if exists t5 ;
create table t5 create table t5
( (
product_file_id int auto_increment primary key, product_file_id int auto_increment primary key,
...@@ -847,7 +842,6 @@ file_included int not null default 1, ...@@ -847,7 +842,6 @@ file_included int not null default 1,
unique product_file(product_id,file_name), unique product_file(product_id,file_name),
index file_included(file_included) index file_included(file_included)
) type=bdb; ) type=bdb;
drop table if exists t6 ;
create table t6 create table t6
( (
file_platform_id int auto_increment primary key, file_platform_id int auto_increment primary key,
...@@ -860,7 +854,6 @@ build_filename varchar(255) not null, ...@@ -860,7 +854,6 @@ build_filename varchar(255) not null,
archive_filename varchar(255) not null, archive_filename varchar(255) not null,
unique file_platform(product_file_id,platform_id,branch_id) unique file_platform(product_file_id,platform_id,branch_id)
) type=bdb; ) type=bdb;
drop table if exists t8 ;
create table t8 create table t8
( (
archive_id int auto_increment primary key, archive_id int auto_increment primary key,
...@@ -872,7 +865,6 @@ status_id int not null default 1, ...@@ -872,7 +865,6 @@ status_id int not null default 1,
unique archive(branch_id,target_id,platform_id,product_id), unique archive(branch_id,target_id,platform_id,product_id),
index status_id(status_id) index status_id(status_id)
) type=bdb; ) type=bdb;
drop table if exists t7 ;
create table t7 create table t7
( (
build_id int auto_increment primary key, build_id int auto_increment primary key,
...@@ -1057,7 +1049,6 @@ KINMU_DATE ...@@ -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; 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 KINMU_DATE
DROP TABLE t1,t2; 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; 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); insert into t1 values (1,1), (1,2);
select * from t1 where a = 1; select * from t1 where a = 1;
......
drop table if exists t1;
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296; select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296 0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 4294967296 0 256 65536 2147483647 -2147483648 2147483648 4294967296
...@@ -7,7 +8,6 @@ select 9223372036854775807,-009223372036854775808; ...@@ -7,7 +8,6 @@ select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999; select +9999999999999999999,-9999999999999999999;
+9999999999999999999 -9999999999999999999 +9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000 10000000000000000000 -10000000000000000000
drop table if exists t1;
create table t1 (a bigint unsigned not null, primary key(a)); create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE); insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1; select * from t1;
......
...@@ -46,10 +46,9 @@ SELECT @a, @b; ...@@ -46,10 +46,9 @@ SELECT @a, @b;
@a @b @a @b
0 6 0 6
DROP TABLE t1; DROP TABLE t1;
drop table if exists t; create table t1 (a int, b int);
create table t(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);
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 t1;
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;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N N N N N N N N N N N
0 N 1 N 0 1 1 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 ...@@ -60,7 +59,7 @@ N 1 N 0 N N N 1 0 0
0 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0
1 0 0 1 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 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 A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N N N N N N N N N N N
0 N 1 N 0 1 1 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 ...@@ -71,4 +70,4 @@ N 1 N 0 N N N 1 0 0
0 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 0
1 0 0 1 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 1 1 0 0 1 0 0 1 0 0
drop table t; drop table t1;
...@@ -13,12 +13,15 @@ select * from t1; ...@@ -13,12 +13,15 @@ select * from t1;
b b
drop table if exists t1; drop table t1;
create table t2 type=heap select * from t1; create table t2 type=heap select * from t1;
Table 'test.t1' doesn't exist Table 'test.t1' doesn't exist
create table t2 select auto+1 from t1; create table t2 select auto+1 from t1;
Table 'test.t1' doesn't exist Table 'test.t1' doesn't exist
drop table if exists t1,t2; 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)); create table t1 (b char(0) not null, index(b));
The used table handler can't index column 'b' The used table handler can't index column 'b'
create table t1 (a int not null auto_increment,primary key (a)) type=heap; create table t1 (a int not null auto_increment,primary key (a)) type=heap;
...@@ -48,6 +51,8 @@ drop table 1ea10; ...@@ -48,6 +51,8 @@ drop table 1ea10;
create table t1 (t1.index int); create table t1 (t1.index int);
drop table t1; drop table t1;
drop database if exists test_$1; drop database if exists test_$1;
Warnings:
Note 1008 Can't drop database 'test_$1'. Database doesn't exist
create database test_$1; create database test_$1;
create table test_$1.$test1 (a$1 int, $b int, c$ int); create table test_$1.$test1 (a$1 int, $b int, c$ int);
insert into test_$1.$test1 values (1,2,3); insert into test_$1.$test1 values (1,2,3);
...@@ -105,12 +110,18 @@ drop table if exists t2; ...@@ -105,12 +110,18 @@ drop table if exists t2;
create table t2 (a int, a float) select * from t1; create table t2 (a int, a float) select * from t1;
Duplicate column name 'a' Duplicate column name 'a'
drop table if exists t2; 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; create table t2 (a int) select a as b, a+1 as b from t1;
Duplicate column name 'b' Duplicate column name 'b'
drop table if exists t2; 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; create table t2 (b int) select a as b, a+1 as b from t1;
Duplicate column name 'b' Duplicate column name 'b'
drop table if exists t1,t2; 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)); 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; show create table t1;
Table Create Table Table Create Table
...@@ -161,7 +172,6 @@ drop table if exists t1; ...@@ -161,7 +172,6 @@ drop table if exists t1;
create table t1 (a int, key(a)); create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b)); 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;
drop table if exists t1, t2, t3;
create table t1(id int not null, name char(20)); create table t1(id int not null, name char(20));
insert into t1 values(10,'mysql'),(20,'monty- the creator'); insert into t1 values(10,'mysql'),(20,'monty- the creator');
create table t2(id int not null); create table t2(id int not null);
...@@ -200,6 +210,8 @@ select * from t3; ...@@ -200,6 +210,8 @@ select * from t3;
id name id name
drop table t2, t3; drop table t2, t3;
drop database if exists test_$1; drop database if exists test_$1;
Warnings:
Note 1008 Can't drop database 'test_$1'. Database doesn't exist
create database test_$1; create database test_$1;
create table test_$1.t3 like t1; create table test_$1.t3 like t1;
create temporary table t3 like test_$1.t3; 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)); ...@@ -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); 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; delete from t1 where a=27;
drop table t1; drop table t1;
drop table if exists t;
CREATE TABLE `t` ( CREATE TABLE `t` (
`i` int(10) NOT NULL default '0', `i` int(10) NOT NULL default '0',
`i2` 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; select * from (select 2 from DUAL) b;
2 2
2 2
...@@ -5,7 +6,6 @@ SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b; ...@@ -5,7 +6,6 @@ SELECT 1 as a FROM (SELECT 1 UNION SELECT a) b;
Unknown column 'a' in 'field list' Unknown column 'a' in 'field list'
SELECT 1 as a FROM (SELECT a UNION SELECT 1) b; SELECT 1 as a FROM (SELECT a UNION SELECT 1) b;
Unknown column 'a' in 'field list' 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); CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
CREATE TABLE t2 (a int not null, b char (10) not null); 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 ...@@ -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 x1 ALL NULL NULL NULL NULL 4
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4
2 DERIVED x1 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; select * from (select 1) as a;
1 1
1 1
...@@ -123,7 +123,7 @@ explain select count(*) from t1 as tt1, (select * from t1) as tt2; ...@@ -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 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 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
2 DERIVED tt1 index NULL a 4 NULL 10000 Using index 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 (SELECT * FROM (SELECT 1 as a) as a )) as b;
(SELECT * FROM (SELECT 1 as a) as a ) (SELECT * FROM (SELECT 1 as a) as a )
1 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)); ...@@ -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 id
2 2
drop table t1,t2,t3; drop table t1,t2,t3;
drop table if exists t1;
create table t1 (a int not null, b int not null, t time); 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"); 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; 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:// ...@@ -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); 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 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 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); CREATE TABLE t1 (a int primary key, b int, c int);
INSERT t1 VALUES (1,2,3); INSERT t1 VALUES (1,2,3);
CREATE TABLE t2 (a int primary key, b int, c int); CREATE TABLE t2 (a int primary key, b int, c int);
...@@ -418,4 +417,4 @@ INSERT t2 VALUES (3,4,5); ...@@ -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; SELECT DISTINCT t1.a, t2.b FROM t1, t2 WHERE t1.a=1 ORDER BY t2.c;
a b a b
1 4 1 4
DROP TABLE IF EXISTS t1,t2; DROP TABLE t1,t2;
drop table if exists t1; drop table if exists t1;
drop table if exists t1;
drop table t1; drop table t1;
Unknown table 't1' Unknown table 't1'
create table t1(n int); create table t1(n int);
...@@ -13,6 +12,8 @@ select * from t1; ...@@ -13,6 +12,8 @@ select * from t1;
n n
1 1
drop database if exists mysqltest; drop database if exists mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
create database mysqltest; create database mysqltest;
drop database if exists mysqltest; drop database if exists mysqltest;
create database mysqltest; create database mysqltest;
...@@ -25,6 +26,8 @@ drop database if exists mysqltest; ...@@ -25,6 +26,8 @@ drop database if exists mysqltest;
create database mysqltest; create database mysqltest;
drop database mysqltest; drop database mysqltest;
drop database if exists mysqltest; drop database if exists mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'. Database doesn't exist
flush tables with read lock; flush tables with read lock;
create database mysqltest; create database mysqltest;
Got one of the listed errors 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); create temporary table t1(n int not null primary key);
drop table if exists t2;
create table t2(n int); create table t2(n int);
insert into t2 values(3); insert into t2 values(3);
select * from t1; select * from t1;
...@@ -11,7 +11,6 @@ drop table t2; ...@@ -11,7 +11,6 @@ drop table t2;
Table 't2' was locked with a READ lock and can't be updated Table 't2' was locked with a READ lock and can't be updated
drop table t2; drop table t2;
unlock tables; unlock tables;
drop database if exists mysqltest;
create database mysqltest; create database mysqltest;
create table mysqltest.t1(n int); create table mysqltest.t1(n int);
insert into mysqltest.t1 values (23); insert into mysqltest.t1 values (23);
......
...@@ -206,7 +206,6 @@ select 8 from t1; ...@@ -206,7 +206,6 @@ select 8 from t1;
8 8
8 8
drop table t1; drop table t1;
drop table if exists t1;
create table t1 (a text, fulltext key (a)); create table t1 (a text, fulltext key (a));
insert into t1 values ('aaaa'); insert into t1 values ('aaaa');
repair table t1; repair table t1;
......
use test;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int(11) NOT NULL auto_increment, a int(11) NOT NULL auto_increment,
......
use test;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a INT AUTO_INCREMENT PRIMARY KEY, a INT AUTO_INCREMENT PRIMARY KEY,
......
drop table if exists t1,t2;
select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL; select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL;
0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL 0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL
1 1 1 1 1 1 1 1
...@@ -10,7 +11,6 @@ select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0; ...@@ -10,7 +11,6 @@ select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0;
select "A"<=>"B","A"<=>NULL,NULL<=>"A"; select "A"<=>"B","A"<=>NULL,NULL<=>"A";
"A"<=>"B" "A"<=>NULL NULL<=>"A" "A"<=>"B" "A"<=>NULL NULL<=>"A"
0 0 0 0 0 0
drop table if exists t1,t2;
create table t1 (id int, value int); create table t1 (id int, value int);
create table t2 (id int, value int); create table t2 (id int, value int);
insert into t1 values (1,null); insert into t1 values (1,null);
......
drop table if exists t1;
select 1 in (1,2,3); select 1 in (1,2,3);
1 in (1,2,3) 1 in (1,2,3)
1 1
...@@ -34,7 +35,6 @@ select 3.5 in (1.5,NULL,3.5); ...@@ -34,7 +35,6 @@ select 3.5 in (1.5,NULL,3.5);
select 10.5 in (1.5,NULL,3.5); select 10.5 in (1.5,NULL,3.5);
10.5 in (1.5,NULL,3.5) 10.5 in (1.5,NULL,3.5)
NULL NULL
drop table if exists t1;
CREATE TABLE t1 (a int, b int, c int); CREATE TABLE t1 (a int, b int, c int);
insert into t1 values (1,2,3), (1,NULL,3); insert into t1 values (1,2,3), (1,NULL,3);
select 1 in (a,b,c) from t1; 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") ...@@ -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"); 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") find_in_set("abc","abc") find_in_set("ab","abc") find_in_set("abcd","abc")
1 0 0 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; drop table if exists t1;
CREATE TABLE obory ( CREATE TABLE t1 (
kodoboru varchar(10) default NULL, kodoboru varchar(10) default NULL,
obor tinytext, obor tinytext,
aobor tinytext, aobor tinytext,
...@@ -7,14 +7,14 @@ UNIQUE INDEX kodoboru (kodoboru), ...@@ -7,14 +7,14 @@ UNIQUE INDEX kodoboru (kodoboru),
FULLTEXT KEY obor (obor), FULLTEXT KEY obor (obor),
FULLTEXT KEY aobor (aobor) FULLTEXT KEY aobor (aobor)
); );
INSERT INTO obory VALUES ('0101000000','aaa','AAA'); INSERT INTO t1 VALUES ('0101000000','aaa','AAA');
INSERT INTO obory VALUES ('0102000000','bbb','BBB'); INSERT INTO t1 VALUES ('0102000000','bbb','BBB');
INSERT INTO obory VALUES ('0103000000','ccc','CCC'); INSERT INTO t1 VALUES ('0103000000','ccc','CCC');
INSERT INTO obory VALUES ('0104000000','xxx','XXX'); INSERT INTO t1 VALUES ('0104000000','xxx','XXX');
select * from obory; select * from t1;
kodoboru obor aobor kodoboru obor aobor
0101000000 aaa AAA 0101000000 aaa AAA
0102000000 bbb BBB 0102000000 bbb BBB
0103000000 ccc CCC 0103000000 ccc CCC
0104000000 xxx XXX 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); SELECT 1 FROM (SELECT 1) as a GROUP BY SUM(1);
Invalid use of group function Invalid use of group function
drop table if exists t1,t2,t3;
CREATE TABLE t1 ( CREATE TABLE t1 (
spID int(10) unsigned, spID int(10) unsigned,
userID 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 ...@@ -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) userid MIN(t1.score+0.0)
1 1.0 1 1.0
2 2.0 2 2.0
drop table test.t1,test.t2; drop table t1,t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, PID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
payDate date DEFAULT '0000-00-00' NOT NULL, payDate date DEFAULT '0000-00-00' NOT NULL,
...@@ -390,7 +390,6 @@ CONCAT(a, b) count(*) ...@@ -390,7 +390,6 @@ CONCAT(a, b) count(*)
abcdef 1 abcdef 1
hijklm 2 hijklm 2
DROP TABLE t1; DROP TABLE t1;
drop table if exists t1;
create table t1 (One int unsigned, Two int unsigned, Three int unsigned, Four int unsigned); 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); 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; 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; create table t1 (id integer, x integer) type=INNODB;
insert into t1 values(0, 0); insert into t1 values(0, 0);
set autocommit=0; set autocommit=0;
...@@ -18,7 +18,6 @@ id x ...@@ -18,7 +18,6 @@ id x
0 2 0 2
commit; commit;
drop table t1; drop table t1;
drop table if exists t1, t2;
create table t1 (id integer, x integer) type=INNODB; create table t1 (id integer, x integer) type=INNODB;
create table t2 (b integer, a integer) type=INNODB; create table t2 (b integer, a integer) type=INNODB;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
......
...@@ -1021,7 +1021,6 @@ id code name ...@@ -1021,7 +1021,6 @@ id code name
7 4 Matt 7 4 Matt
COMMIT; COMMIT;
DROP TABLE t1; DROP TABLE t1;
drop table if exists t1,t2;
create table t1 (n int(10), d int(10)) type=innodb; create table t1 (n int(10), d int(10)) type=innodb;
create table t2 (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); insert into t1 values(1,1),(1,2);
......
drop table if exists t1, t2, t3; drop table if exists t1,t2,t3;
flush status; flush status;
set autocommit=0; set autocommit=0;
create table t1 (a int not null) type=innodb; 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; create table t1 (a int, b char(10), key a(a), key b(a,b)) type=innodb;
insert into t1 values insert into t1 values
(17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"), (17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"),
......
...@@ -58,9 +58,9 @@ skr 2 ...@@ -58,9 +58,9 @@ skr 2
test 1 test 1
test 2 test 2
drop table t1; drop table t1;
drop database if exists foo; drop database if exists test_$1;
create database foo; create database test_$1;
use foo; use test_$1;
create table t1 (c int); create table t1 (c int);
insert into foo.t1 set foo.t1.c = '1'; insert into test_$1.t1 set test_$1.t1.c = '1';
drop database foo; drop database test_$1;
...@@ -21,8 +21,7 @@ payoutID ...@@ -21,8 +21,7 @@ payoutID
20 20
22 22
drop table t1,t2; drop table t1,t2;
DROP TABLE IF EXISTS crash1,crash2; CREATE TABLE `t1` (
CREATE TABLE `crash1` (
`numeropost` bigint(20) unsigned NOT NULL default '0', `numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment, `numreponse` bigint(20) unsigned NOT NULL auto_increment,
...@@ -37,7 +36,7 @@ KEY `date` (`date`), ...@@ -37,7 +36,7 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`), KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`) KEY `numreponse` (`numreponse`)
) TYPE=MyISAM; ) TYPE=MyISAM;
CREATE TABLE `crash2` ( CREATE TABLE `t2` (
`numeropost` bigint(20) unsigned NOT NULL default '0', `numeropost` bigint(20) unsigned NOT NULL default '0',
`icone` tinyint(4) unsigned NOT NULL default '0', `icone` tinyint(4) unsigned NOT NULL default '0',
`numreponse` bigint(20) unsigned NOT NULL auto_increment, `numreponse` bigint(20) unsigned NOT NULL auto_increment,
...@@ -52,17 +51,17 @@ KEY `date` (`date`), ...@@ -52,17 +51,17 @@ KEY `date` (`date`),
KEY `pseudo` (`pseudo`), KEY `pseudo` (`pseudo`),
KEY `numreponse` (`numreponse`) KEY `numreponse` (`numreponse`)
) TYPE=MyISAM; ) TYPE=MyISAM;
INSERT INTO crash2 INSERT INTO t2
(numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES (numeropost,icone,numreponse,contenu,pseudo,date,ip,signature) VALUES
(9,1,56,'test','joce','2001-07-25 13:50:53' (9,1,56,'test','joce','2001-07-25 13:50:53'
,3649052399,0); ,3649052399,0);
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip) INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM crash2 SELECT 1618,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; WHERE numeropost=9 ORDER BY numreponse ASC;
show variables like '%bulk%'; show variables like '%bulk%';
Variable_name Value Variable_name Value
bulk_insert_buffer_size 8388608 bulk_insert_buffer_size 8388608
INSERT INTO crash1 (numeropost,icone,contenu,pseudo,date,signature,ip) INSERT INTO t1 (numeropost,icone,contenu,pseudo,date,signature,ip)
SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM crash2 SELECT 1718,icone,contenu,pseudo,date,signature,ip FROM t2
WHERE numeropost=9 ORDER BY numreponse ASC; 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 ...@@ -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; 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 Column 'ordid' is used with UNIQUE or INDEX but is not defined as NOT NULL
drop table if exists t1; 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)); 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); insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
create table t2 type=isam select * from t1; 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 ...@@ -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 usr_id uniq_id increment usr2_id c_amount max
3 4 84676 NULL NULL NULL 3 4 84676 NULL NULL NULL
drop table t1,t2; drop table t1,t2;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 ( CREATE TABLE t1 (
cod_asig int(11) DEFAULT '0' NOT NULL, cod_asig int(11) DEFAULT '0' NOT NULL,
desc_larga_cat varchar(80) DEFAULT '' NOT NULL, desc_larga_cat varchar(80) DEFAULT '' NOT NULL,
......
...@@ -147,7 +147,6 @@ t1 0 e 1 e A 0 NULL NULL BTREE ...@@ -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 0 b 1 b A NULL NULL NULL YES BTREE
t1 1 c 1 c A NULL NULL NULL YES BTREE t1 1 c 1 c A NULL NULL NULL YES BTREE
drop table t1; drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT, CREATE TABLE t1 (c CHAR(10) NOT NULL,i INT NOT NULL AUTO_INCREMENT,
UNIQUE (c,i)); UNIQUE (c,i));
INSERT INTO t1 (c) VALUES (NULL),(NULL); INSERT INTO t1 (c) VALUES (NULL),(NULL);
......
...@@ -181,6 +181,8 @@ Can't open file: 't4.MRG'. (errno: 143) ...@@ -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); 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 Incorrect table definition; All MERGE tables must be in the same database
drop table if exists t5,t4,t3,t1,t2; 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 t1 (c char(10)) type=myisam;
create table t2 (c char(10)) type=myisam; create table t2 (c char(10)) type=myisam;
create table t3 (c char(10)) union=(t1,t2) type=merge; create table t3 (c char(10)) union=(t1,t2) type=merge;
...@@ -262,7 +264,6 @@ create table t1 (a int not null) type=merge; ...@@ -262,7 +264,6 @@ create table t1 (a int not null) type=merge;
select * from t1; select * from t1;
a a
drop table t1; 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 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 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); 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 ...@@ -274,7 +275,6 @@ a b
1 1 1 1
1 2 1 2
drop table t3,t1,t2; 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 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 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; 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 ' ...@@ -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); 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; 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); 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); 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 t where a = 2; select max(b) from t3 where a = 2;
max(b) max(b)
NULL NULL
select max(b) from t1 where a = 2; select max(b) from t1 where a = 2;
max(b) max(b)
1 1
drop table if exists t,t1,t2; drop table if exists t3,t1,t2;
drop table if exists t1, t2, t3, t4, t5, t6;
create table t1 (a int not null); create table t1 (a int not null);
create table t2 (a int not null); create table t2 (a int not null);
insert into t1 values (1); insert into t1 values (1);
...@@ -561,7 +560,6 @@ a ...@@ -561,7 +560,6 @@ a
1 1
2 2
drop table if exists t6, t3, t1, t2, t4, t5; drop table if exists t6, t3, t1, t2, t4, t5;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
fileset_id tinyint(3) unsigned NOT NULL default '0', fileset_id tinyint(3) unsigned NOT NULL default '0',
file_code varchar(32) NOT NULL default '', file_code varchar(32) NOT NULL default '',
...@@ -595,4 +593,4 @@ EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 ...@@ -595,4 +593,4 @@ EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2
AND file_code = '0000000115' LIMIT 1; AND file_code = '0000000115' LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 const PRIMARY,files PRIMARY 33 const,const 1 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 ...@@ -96,7 +96,7 @@ id mydate
5 2002-05-12 00:00:00 5 2002-05-12 00:00:00
6 2002-06-22 00:00:00 6 2002-06-22 00:00:00
7 2002-07-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` ( CREATE TABLE IF NOT EXISTS `t1` (
`id` int(11) NOT NULL auto_increment, `id` int(11) NOT NULL auto_increment,
`tst` text, `tst` text,
...@@ -125,7 +125,7 @@ ID ParId tst tst1 ...@@ -125,7 +125,7 @@ ID ParId tst tst1
1 1 MySQL MySQL AB 1 1 MySQL MySQL AB
2 2 MSSQL Microsoft 2 2 MSSQL Microsoft
3 3 ORACLE ORACLE 3 3 ORACLE ORACLE
drop table if exists t1, t2 ; drop table t1, t2 ;
create table t1 (n numeric(10)); create table t1 (n numeric(10));
create table t2 (n numeric(10)); create table t2 (n numeric(10));
insert into t2 values (1),(2),(4),(8),(16),(32); insert into t2 values (1),(2),(4),(8),(16),(32);
...@@ -251,7 +251,6 @@ n d ...@@ -251,7 +251,6 @@ n d
select * from t2; select * from t2;
n d n d
drop table t1,t2; 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; 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,''); 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; 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 ...@@ -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'); INSERT INTO t3 VALUES (1,'jedan'),(2,'dva');
update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj; 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; 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; ...@@ -83,7 +83,6 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
DROP TABLE t1; DROP TABLE t1;
drop table if exists t1;
create table t1 ( t1 char(255), key(t1(250))); create table t1 ( t1 char(255), key(t1(250)));
insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169'); insert t1 values ('137513751375137513751375137513751375137569516951695169516951695169516951695169');
insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203'); insert t1 values ('178417841784178417841784178417841784178403420342034203420342034203420342034203');
...@@ -121,7 +120,6 @@ check table t1; ...@@ -121,7 +120,6 @@ check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
drop table t1; 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 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, 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, 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, ...@@ -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, 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` ( CREATE TABLE `t1` (
`post_id` mediumint(8) unsigned NOT NULL auto_increment, `post_id` mediumint(8) unsigned NOT NULL auto_increment,
`topic_id` mediumint(8) unsigned NOT NULL default '0', `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; 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 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 NULL NULL 1 1 1 1 TRUE TRUE 1 1
...@@ -34,7 +35,6 @@ NULL AND 0 0 and NULL ...@@ -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(""); 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("") inet_ntoa(null) inet_aton(null) inet_aton("122.256") inet_aton("122.226.") inet_aton("")
NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
drop table if exists t1;
create table t1 (x int); create table t1 (x int);
insert into t1 values (null); insert into t1 values (null);
select * from t1 where x != 0; 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; 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); 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; explain select * from t1 where a is null;
...@@ -136,7 +136,6 @@ select * from t1 where b like "6%"; ...@@ -136,7 +136,6 @@ select * from t1 where b like "6%";
a b c a b c
6 6 0 6 6 0
drop table t1; drop table t1;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 ( CREATE TABLE t1 (
id int(10) unsigned NOT NULL auto_increment, id int(10) unsigned NOT NULL auto_increment,
uniq_id int(10) unsigned default NULL, uniq_id int(10) unsigned default NULL,
......
drop table if exists t1;
select {fn length("hello")}, { date "1997-10-20" }; select {fn length("hello")}, { date "1997-10-20" };
{fn length("hello")} 1997-10-20 {fn length("hello")} 1997-10-20
5 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)); 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=1;
insert into t1 SET a=null,b=2; insert into t1 SET a=null,b=2;
......
drop table if exists sales; drop table if exists t1;
create table sales ( product varchar(32), country varchar(32), year int, profit int); create table t1 ( product varchar(32), country varchar(32), year int, profit int);
insert into sales values ( 'Computer', 'India',2000, 1200), insert into t1 values ( 'Computer', 'India',2000, 1200),
( 'TV', 'United States', 1999, 150), ( 'TV', 'United States', 1999, 150),
( 'Calculator', 'United States', 1999,50), ( 'Calculator', 'United States', 1999,50),
( 'Computer', 'United States', 1999,1500), ( 'Computer', 'United States', 1999,1500),
...@@ -14,14 +14,14 @@ insert into sales values ( 'Computer', 'India',2000, 1200), ...@@ -14,14 +14,14 @@ insert into sales values ( 'Computer', 'India',2000, 1200),
( 'Computer', 'India', 1999,1200), ( 'Computer', 'India', 1999,1200),
( 'Computer', 'United States', 2000,1500), ( 'Computer', 'United States', 2000,1500),
( 'Calculator', 'United States', 2000,75); ( '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' 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' 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' 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' 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' This version of MySQL doesn't yet support 'CUBE'
drop table sales; drop table t1;
...@@ -222,7 +222,6 @@ DateOfAction TransactionID ...@@ -222,7 +222,6 @@ DateOfAction TransactionID
1999-07-27 834 1999-07-27 834
1999-07-27 840 1999-07-27 840
drop table t1,t2,t3; drop table t1,t2,t3;
drop table if exists t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
member_id int(11) NOT NULL auto_increment, member_id int(11) NOT NULL auto_increment,
inschrijf_datum varchar(20) NOT NULL default '', inschrijf_datum varchar(20) NOT NULL default '',
......
...@@ -2,6 +2,7 @@ flush query cache; ...@@ -2,6 +2,7 @@ flush query cache;
flush query cache; flush query cache;
reset query cache; reset query cache;
flush status; flush status;
drop database if exists mysqltest;
drop table if exists t1,t2,t3,t11,t21, mysqltest.t1; drop table if exists t1,t2,t3,t11,t21, mysqltest.t1;
create table t1 (a int not null); create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
......
...@@ -37,3 +37,5 @@ select * from t3; ...@@ -37,3 +37,5 @@ select * from t3;
3 table 3 3 table 3
3 table 3 3 table 3
drop table if exists t1,t2,t3,t4; 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)); 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)) row(1,2,3) IN (row(3,2,3), row(1,2,3), row(1,3,3))
1 1
...@@ -88,7 +89,6 @@ ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL)) ...@@ -88,7 +89,6 @@ ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL))
NULL NULL
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4); SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4);
Cardinality error (more/less than 2 columns) Cardinality error (more/less than 2 columns)
drop table if exists t1;
create table t1 ( a int, b int, c int); 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); 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); 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)) ...@@ -127,7 +127,6 @@ ROW(1,2,3) IN(row(a,b,c), row(1,2,3))
drop table t1; drop table t1;
select ROW(1,1); select ROW(1,1);
Cardinality error (more/less than 1 columns) Cardinality error (more/less than 1 columns)
drop table if exists t1;
create table t1 (i int); create table t1 (i int);
select 1 from t1 where ROW(1,1); select 1 from t1 where ROW(1,1);
Cardinality error (more/less than 1 columns) Cardinality error (more/less than 1 columns)
......
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1,t2,t3;
create table t1 (word char(20) not null); create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words.dat' into table t1;
load data local infile 'MYSQL_TEST_DIR/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; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1;
create table t1 (n int auto_increment primary key); create table t1 (n int auto_increment primary key);
set insert_id = 2000; set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL); insert into t1 values (NULL),(NULL),(NULL);
...@@ -18,7 +17,6 @@ Server_id Host Port Rpl_recovery_rank Master_id ...@@ -18,7 +17,6 @@ Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 9999 2 1 2 127.0.0.1 9999 2 1
drop table t1; drop table t1;
stop slave; stop slave;
drop table if exists t2;
create table t2(id int auto_increment primary key, created datetime); create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345; set timestamp=12345;
insert into t2 set created=now(); 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; ...@@ -5,18 +5,13 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
drop table if exists t1;
create table t1 (word char(20) not null, index(word)); create table t1 (word char(20) not null, index(word));
load data infile '../../std_data/words.dat' into table t1; load data infile '../../std_data/words.dat' into table t1;
drop table if exists t2;
create table t2 (word char(20) not null); create table t2 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t2; load data infile '../../std_data/words.dat' into table t2;
create table t3 (word char(20) not null primary key); create table t3 (word char(20) not null primary key);
drop table if exists t1;
load table t1 from master; load table t1 from master;
drop table if exists t2;
load table t2 from master; load table t2 from master;
drop table if exists t3;
load table t3 from master; load table t3 from master;
check table t1; check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
......
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1;
CREATE TABLE t1 (name varchar(64), age smallint(3)); CREATE TABLE t1 (name varchar(64), age smallint(3));
INSERT INTO t1 SET name='Andy', age=31; INSERT INTO t1 SET name='Andy', age=31;
INSERT t1 SET name='Jacob', age=2; INSERT t1 SET name='Jacob', age=2;
......
...@@ -5,13 +5,11 @@ reset slave; ...@@ -5,13 +5,11 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
set SQL_LOG_BIN=0,timestamp=200006; set SQL_LOG_BIN=0,timestamp=200006;
drop table if exists t1;
create table t1(t timestamp not null,a char(1)); create table t1(t timestamp not null,a char(1));
insert into t1 ( a) values ('F'); insert into t1 ( a) values ('F');
select unix_timestamp(t) from t1; select unix_timestamp(t) from t1;
unix_timestamp(t) unix_timestamp(t)
200006 200006
drop table if exists t1;
load table t1 from master; load table t1 from master;
select unix_timestamp(t) from t1; select unix_timestamp(t) from t1;
unix_timestamp(t) unix_timestamp(t)
......
...@@ -5,21 +5,19 @@ reset slave; ...@@ -5,21 +5,19 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
use test; use test;
drop table if exists foo; drop table if exists mysqltest_foo;
create table foo (n int); drop table if exists mysqltest_bar;
insert into foo values(4); create table mysqltest_foo (n int);
insert into mysqltest_foo values(4);
use test; use test;
drop table if exists foo; create table mysqltest_foo (n int);
create table foo (n int); insert into mysqltest_foo values(5);
insert into foo values(5); create table mysqltest_bar (m int);
drop table if exists bar; insert into mysqltest_bar values(15);
create table bar (m int); create table t1 (k int);
insert into bar values(15); insert into t1 values(55);
drop table if exists choo; select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1;
create table choo (k int);
insert into choo values(55);
select foo.n,bar.m,choo.k from foo,bar,choo;
n m k n m k
4 15 55 4 15 55
drop table if exists foo,bar,choo; drop table mysqltest_foo,mysqltest_bar,t1;
drop table if exists foo,bar,choo; drop table mysqltest_foo,mysqltest_bar,t1;
...@@ -4,80 +4,78 @@ reset master; ...@@ -4,80 +4,78 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop database if exists foo; drop database if exists mysqltest2;
create database foo; create database mysqltest2;
drop database if exists bar; drop database if exists mysqltest;
create database bar; create database mysqltest;
drop table if exists foo.foo; create table mysqltest2.foo (n int);
create table foo.foo (n int); insert into mysqltest2.foo values(4);
insert into foo.foo values(4); create table mysqltest2.foo (n int);
drop table if exists foo.foo; insert into mysqltest2.foo values(5);
create table foo.foo (n int); create table mysqltest.bar (m int);
insert into foo.foo values(5); insert into mysqltest.bar values(15);
drop table if exists bar.bar; select mysqltest2.foo.n,mysqltest.bar.m from mysqltest2.foo,mysqltest.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;
n m n m
4 15 4 15
drop database if exists bar; drop database mysqltest;
drop database if exists foo; drop database mysqltest2;
drop database if exists bar;
drop database if exists foo;
set sql_log_bin = 0; set sql_log_bin = 0;
create database foo; create database mysqltest2;
create database bar; create database mysqltest;
show databases; show databases;
Database Database
bar
foo
mysql mysql
mysqltest
mysqltest2
test test
create table foo.t1(n int, s char(20)); create table mysqltest2.t1(n int, s char(20));
create table foo.t2(n int, s text); create table mysqltest2.t2(n int, s text);
insert into foo.t1 values (1, 'one'), (2, 'two'), (3, 'three'); insert into mysqltest2.t1 values (1, 'one'), (2, 'two'), (3, 'three');
insert into foo.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen'); insert into mysqltest2.t2 values (11, 'eleven'), (12, 'twelve'), (13, 'thirteen');
create table bar.t1(n int, s char(20)); create table mysqltest.t1(n int, s char(20));
create table bar.t2(n int, s text); create table mysqltest.t2(n int, s text);
insert into bar.t1 values (1, 'one bar'), (2, 'two bar'), (3, 'three bar'); insert into mysqltest.t1 values (1, 'one test'), (2, 'two test'), (3, 'three test');
insert into bar.t2 values (11, 'eleven bar'), (12, 'twelve bar'), insert into mysqltest.t2 values (11, 'eleven test'), (12, 'twelve test'),
(13, 'thirteen bar'); (13, 'thirteen test');
set sql_log_bin = 1; set sql_log_bin = 1;
show databases; show databases;
Database Database
mysql mysql
test test
load data from master; 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; show databases;
Database Database
bar
foo
mysql mysql
mysqltest
mysqltest2
test test
use foo; use mysqltest2;
show tables; show tables;
Tables_in_foo Tables_in_mysqltest2
use bar; use mysqltest;
show tables; show tables;
Tables_in_bar Tables_in_mysqltest
t1 t1
t2 t2
select * from bar.t1; select * from mysqltest.t1;
n s n s
1 one bar 1 one test
2 two bar 2 two test
3 three bar 3 three test
select * from bar.t2; select * from mysqltest.t2;
n s n s
11 eleven bar 11 eleven test
12 twelve bar 12 twelve test
13 thirteen bar 13 thirteen test
insert into bar.t1 values (4, 'four bar'); insert into mysqltest.t1 values (4, 'four test');
select * from bar.t1; select * from mysqltest.t1;
n s n s
1 one bar 1 one test
2 two bar 2 two test
3 three bar 3 three test
4 four bar 4 four test
drop database bar; drop database mysqltest;
drop database foo; drop database mysqltest2;
...@@ -4,8 +4,6 @@ reset master; ...@@ -4,8 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1;
drop table if exists t1;
create table t1 (n int not null auto_increment primary key); create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL); insert into t1 values(NULL);
insert into t1 values(2); insert into t1 values(2);
......
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1;
create table t1 (n int); create table t1 (n int);
insert into t1 values(1); insert into t1 values(1);
stop slave; stop slave;
......
...@@ -4,18 +4,16 @@ reset master; ...@@ -4,18 +4,16 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1,t2,t3;
create table t2 (n int); create table t2 (n int);
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values(1),(2),(3); insert into t1 values(1),(2),(3);
insert into t2 select * from t1; insert into t2 select * from t1;
drop table if exists test.t3; create temporary table t3 (n int not null);
create temporary table test.t3 (n int not null); alter table t3 add primary key(n);
alter table test.t3 add primary key(n);
flush logs; flush logs;
insert into t3 values (100); insert into t3 values (100);
insert into t2 select * from t3; insert into t2 select * from t3;
drop table if exists test.t3; drop table if exists t3;
insert into t2 values (101); insert into t2 values (101);
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values (4),(5); insert into t1 values (4),(5);
...@@ -35,3 +33,5 @@ show status like 'Slave_open_temp_tables'; ...@@ -35,3 +33,5 @@ show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
drop table if exists t1,t2; drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t2;
create table t2(n int); create table t2(n int);
create temporary table t1 (n int); create temporary table t1 (n int);
insert into t1 values(1),(2),(3); insert into t1 values(1),(2),(3);
...@@ -25,3 +24,5 @@ show status like 'Slave_open_temp_tables'; ...@@ -25,3 +24,5 @@ show status like 'Slave_open_temp_tables';
Variable_name Value Variable_name Value
Slave_open_temp_tables 0 Slave_open_temp_tables 0
drop table if exists t1,t2; drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 't1'
...@@ -4,18 +4,18 @@ reset master; ...@@ -4,18 +4,18 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop database if exists d1; drop database if exists test_$1;
create database d1; create database test_$1;
create table d1.t1 ( n int); create table test_$1.t1 ( n int);
alter table d1.t1 add m int; alter table test_$1.t1 add m int;
insert into d1.t1 values (1,2); insert into test_$1.t1 values (1,2);
create table d1.t2 (n int); create table test_$1.t2 (n int);
insert into d1.t2 values (45); insert into test_$1.t2 values (45);
rename table d1.t2 to d1.t3, d1.t1 to d1.t2; rename table test_$1.t2 to test_$1.t3, test_$1.t1 to test_$1.t2;
select * from d1.t2; select * from test_$1.t2;
n m n m
1 2 1 2
select * from d1.t3; select * from test_$1.t3;
n n
45 45
drop database d1; drop database test_$1;
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1;
show slave status; 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 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; load table t1 from master;
......
...@@ -9,7 +9,6 @@ Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Lo ...@@ -9,7 +9,6 @@ Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Lo
SHOW SLAVE HOSTS; SHOW SLAVE HOSTS;
Server_id Host Port Rpl_recovery_rank Master_id Server_id Host Port Rpl_recovery_rank Master_id
2 127.0.0.1 SLAVE_PORT 2 1 2 127.0.0.1 SLAVE_PORT 2 1
drop table if exists t1;
create table t1 ( n int); create table t1 ( n int);
insert into t1 values (1),(2),(3),(4); insert into t1 values (1),(2),(3),(4);
insert into t1 values(5); insert into t1 values(5);
......
...@@ -25,4 +25,4 @@ n ...@@ -25,4 +25,4 @@ n
4 4
select * from t11; select * from t11;
Table 'test.t11' doesn't exist 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 ...@@ -22,7 +22,6 @@ s
Could not break slave Could not break slave
Tried hard Tried hard
flush logs; flush logs;
drop table if exists t2;
create table t2(m int not null auto_increment primary key); create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123); insert into t2 values (34),(67),(123);
flush logs; flush logs;
...@@ -58,7 +57,6 @@ m ...@@ -58,7 +57,6 @@ m
1234 1234
create temporary table temp_table (a char(80) not null); create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2"); insert into temp_table values ("testing temporary tables part 2");
drop table if exists t3;
create table t3 (n int); create table t3 (n int);
create table t4 select * from temp_table; create table t4 select * from temp_table;
show binary logs; show binary logs;
......
...@@ -4,7 +4,6 @@ reset master; ...@@ -4,7 +4,6 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1;
create table t1 (n int not null primary key); create table t1 (n int not null primary key);
insert into t1 values (1); insert into t1 values (1);
insert into t1 values (1); insert into t1 values (1);
......
...@@ -4,9 +4,8 @@ reset master; ...@@ -4,9 +4,8 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
drop table if exists t1; drop table if exists t1,t2;
create table t1(f int); create table t1(f int);
drop table if exists t2;
create table t2(f int); create table t2(f int);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
create temporary table t3(f int); 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 ...@@ -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 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 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 master-bin.000001 781 Query 1 781 use `test`; drop temporary table t3
drop table if exists t1; drop table t1, t2;
drop table if exists t2;
use test; use test;
SET TIMESTAMP=1040323920; SET TIMESTAMP=1040323920;
create table t1(f int); create table t1(f int);
...@@ -72,3 +70,4 @@ select * from t2; ...@@ -72,3 +70,4 @@ select * from t2;
f f
5 5
7 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; drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 ( CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
...@@ -2493,7 +2492,6 @@ fld1 fld3 period price price2 ...@@ -2493,7 +2492,6 @@ fld1 fld3 period price price2
018601 vacuuming 1001 5987435 234724 018601 vacuuming 1001 5987435 234724
018801 inch 1001 5987435 234724 018801 inch 1001 5987435 234724
018811 repetitions 1001 5987435 234724 018811 repetitions 1001 5987435 234724
drop table if exists company;
create table t4 ( create table t4 (
companynr tinyint(2) unsigned zerofill NOT NULL default '00', companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '', companyname char(30) NOT NULL default '',
...@@ -3478,7 +3476,6 @@ a a a ...@@ -3478,7 +3476,6 @@ a a a
2 2 2 2 2 2
3 3 3 3 3 3
drop table t1; 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; 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); 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; CREATE TABLE t2 ( id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) TYPE=MyISAM;
...@@ -3490,4 +3487,4 @@ aa id t2_id id ...@@ -3490,4 +3487,4 @@ aa id t2_id id
4 8302 2519 2519 4 8302 2519 2519
5 8303 2520 2520 5 8303 2520 2520
6 8304 2521 2521 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 (select 2);
(select 2) (select 2)
2 2
...@@ -119,7 +120,6 @@ SELECT (SELECT 1.5,2,'a') = ROW(1.5,'c','a'); ...@@ -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 (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
(SELECT 1.5,'c','a') = ROW(1.5,2,'a') (SELECT 1.5,'c','a') = ROW(1.5,2,'a')
0 0
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
create table t1 (a int); create table t1 (a int);
create table t2 (a int, b int); create table t2 (a int, b int);
create table t3 (a int); create table t3 (a int);
...@@ -310,7 +310,6 @@ W 1 ...@@ -310,7 +310,6 @@ W 1
SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3); SELECT * FROM t3 WHERE b = (SELECT MIN(b) FROM t3);
a b a b
W a W a
drop table if exists t8;
CREATE TABLE `t8` ( CREATE TABLE `t8` (
`pseudo` varchar(35) character set latin1 NOT NULL default '', `pseudo` varchar(35) character set latin1 NOT NULL default '',
`email` varchar(60) character set latin1 NOT NULL default '', `email` varchar(60) character set latin1 NOT NULL default '',
...@@ -520,7 +519,6 @@ a b ...@@ -520,7 +519,6 @@ a b
0 10 0 10
1 11 1 11
drop table t1, t2; 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 t11 (a int NOT NULL, b int, primary key (a));
create table t12 (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)); create table t2 (a int NOT NULL, b int, primary key (a));
...@@ -626,7 +624,6 @@ x y ...@@ -626,7 +624,6 @@ x y
drop table t1, t2, t3; drop table t1, t2, t3;
SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *); SELECT * FROM (SELECT 1) b WHERE 1 IN (SELECT *);
No tables used No tables used
drop table if exists t;
CREATE TABLE t (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1; CREATE TABLE t (id int(11) default NULL, KEY id (id)) TYPE=MyISAM CHARSET=latin1;
INSERT INTO t VALUES (1),(2); INSERT INTO t VALUES (1),(2);
SELECT * FROM t WHERE id IN (SELECT 1); 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 ...@@ -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 2 0 b
NULL NULL NULL NULL NULL NULL
drop table t1,t2; drop table t1,t2;
drop table if exists t; create table t1 (a int, b real, c varchar(10));
create table t (a int, b real, c varchar(10)); insert into t1 values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b');
insert into t values (1, 1, 'a'), (2,2,'b'), (NULL, 2, 'b'); select ROW(1, 1, 'a') IN (select a,b,c from t1);
select ROW(1, 1, 'a') IN (select a,b,c from t); ROW(1, 1, 'a') IN (select a,b,c from t1)
ROW(1, 1, 'a') IN (select a,b,c from t) 1
1 select ROW(1, 2, 'a') IN (select a,b,c from t1);
select ROW(1, 2, 'a') IN (select a,b,c from t); ROW(1, 2, 'a') IN (select a,b,c from t1)
ROW(1, 2, 'a') IN (select a,b,c from t)
NULL NULL
select 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 t) ROW(1, 1, 'a') IN (select b,a,c from t1)
1 1
select 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 t where a is not null) ROW(1, 1, 'a') IN (select a,b,c from t1 where a is not null)
1 1
select 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 t where a is not null) ROW(1, 2, 'a') IN (select a,b,c from t1 where a is not null)
0 0
select 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 t where a is not null) ROW(1, 1, 'a') IN (select b,a,c from t1 where a is not null)
1 1
select 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 t where c='b' or c='a') ROW(1, 1, 'a') IN (select a,b,c from t1 where c='b' or c='a')
1 1
select 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 t where c='b' or c='a') ROW(1, 2, 'a') IN (select a,b,c from t1 where c='b' or c='a')
NULL NULL
select 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 t where c='b' or c='a') ROW(1, 1, 'a') IN (select b,a,c from t1 where c='b' or c='a')
1 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' This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'
drop table t; drop table t1;
create table t (a int); create table t1 (a int);
insert into t values (1); insert into t1 values (1);
do @a:=(SELECT a from t); do @a:=(SELECT a from t1);
select @a; select @a;
@a @a
1 1
drop table t; drop table t1;
do (SELECT a from t); do (SELECT a from t1);
Table 'test.t' doesn't exist Table 'test.t1' doesn't exist
...@@ -48,7 +48,6 @@ c d e ...@@ -48,7 +48,6 @@ c d e
3 b 2 3 b 2
drop table t1; drop table t1;
drop table t1; drop table t1;
drop table if exists t1;
CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255)); CREATE TABLE t1 (pkCrash INTEGER PRIMARY KEY,strCrash VARCHAR(255));
INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1'); INSERT INTO t1 ( pkCrash, strCrash ) VALUES ( 1, '1');
SELECT CONCAT_WS(pkCrash, strCrash) FROM t1; SELECT CONCAT_WS(pkCrash, strCrash) FROM t1;
...@@ -77,7 +76,6 @@ insert into t1 values (1),(1); ...@@ -77,7 +76,6 @@ insert into t1 values (1),(1);
alter table t1 add primary key (a); alter table t1 add primary key (a);
Duplicate entry '1' for key 1 Duplicate entry '1' for key 1
drop table t1; drop table t1;
drop table if exists t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
d datetime default NULL d datetime default NULL
) TYPE=MyISAM; ) TYPE=MyISAM;
......
drop table if exists t1,t2;
create table t1 (a char(16), b date, c datetime); 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'; 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'; select * from t1 where c = '2000-01-01';
...@@ -7,7 +8,6 @@ select * from t1 where b = '2000-01-01'; ...@@ -7,7 +8,6 @@ select * from t1 where b = '2000-01-01';
a b c a b c
test 2000-01-01 2000-01-01 2000-01-01 00:00:00 test 2000-01-01 2000-01-01 2000-01-01 00:00:00
drop table t1; drop table t1;
drop table if exists t1,t2;
CREATE TABLE t1 (name char(6),cdate date); CREATE TABLE t1 (name char(6),cdate date);
INSERT INTO t1 VALUES ('name1','1998-01-01'); INSERT INTO t1 VALUES ('name1','1998-01-01');
INSERT INTO t1 VALUES ('name2','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; SELECT 10,10.0,10.,.1e+2,100.0e-1;
10 10.0 10. .1e+2 100.0e-1 10 10.0 10. .1e+2 100.0e-1
10 10.0 10 10 10 10 10.0 10 10 10
...@@ -7,7 +8,6 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; ...@@ -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; 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 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 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)); create table t1 (f1 float(24),f2 float(52));
show full columns from t1; show full columns from t1;
Field Type Null Key Default Extra Privileges Comment Field Type Null Key Default Extra Privileges Comment
......
...@@ -170,7 +170,6 @@ testtt ...@@ -170,7 +170,6 @@ testtt
tsestset tsestset
1 1
drop table t1; drop table t1;
drop table if exists t1,t2;
create table t1 (a int); create table t1 (a int);
create table t2 (a int); create table t2 (a int);
insert into t1 values (1),(2),(3),(4),(5); 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)); 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); 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; update t1 set a=a+10 where a > 34;
......
drop table if exists t1,t2;
set @a := foo; set @a := foo;
Unknown column 'foo' in 'field list' Unknown column 'foo' in 'field list'
set @a := connection_id() + 3; set @a := connection_id() + 3;
select @a - connection_id(); select @a - connection_id();
@a - connection_id() @a - connection_id()
3 3
drop table if exists t1,t2;
CREATE TABLE t1 ( i int not null, v int not null,index (i)); CREATE TABLE t1 ( i int not null, v int not null,index (i));
insert into t1 values (1,1),(1,3),(2,1); insert into t1 values (1,1),(1,3),(2,1);
create table t2 (i int not null, unique (i)); create table t2 (i int not null, unique (i));
......
drop table if exists t1;
select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ; select 0x41,0x41+0,0x41 | 0x7fffffffffffffff | 0,0xffffffffffffffff | 0 ;
0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0 0x41 0x41+0 0x41 | 0x7fffffffffffffff | 0 0xffffffffffffffff | 0
A 65 9223372036854775807 18446744073709551615 A 65 9223372036854775807 18446744073709551615
...@@ -7,7 +8,6 @@ select 0x31+1,concat(0x31)+1,-0xf; ...@@ -7,7 +8,6 @@ select 0x31+1,concat(0x31)+1,-0xf;
select x'31',X'ffff'+0; select x'31',X'ffff'+0;
x'31' X'ffff'+0 x'31' X'ffff'+0
1 65535 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) ); 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=0x38afba1d73e6a18a;
insert into t1 set UNIQ=123; 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; set @`test`=1,@TEST=3,@select=2,@t5=1.23456;
select @test,@`select`,@TEST,@not_used; select @test,@`select`,@TEST,@not_used;
@test @`select` @TEST @not_used @test @`select` @TEST @not_used
...@@ -315,7 +315,6 @@ set tmp_table_size=100; ...@@ -315,7 +315,6 @@ set tmp_table_size=100;
set tx_isolation="READ-COMMITTED"; set tx_isolation="READ-COMMITTED";
set wait_timeout=100; set wait_timeout=100;
set log_warnings=1; set log_warnings=1;
DROP TABLE IF EXISTS t1,t2;
create table t1 (a int not null auto_increment, primary key(a)); create table t1 (a int not null auto_increment, primary key(a));
create table t2 (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); insert into t1 values(null),(null),(null);
......
drop table if exists t1; drop table if exists t1;
Warnings:
Note 1051 Unknown table 't1'
create table t1 (a int); create table t1 (a int);
insert into t1 values (1); insert into t1 values (1);
insert into t1 values ("hej"); insert into t1 values ("hej");
...@@ -8,3 +10,6 @@ insert into t1 values ("hej"); ...@@ -8,3 +10,6 @@ insert into t1 values ("hej");
insert into t1 values ("hej"),("d"); insert into t1 values ("hej"),("d");
drop table t1; drop table t1;
set SQL_WARNINGS=0; 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; DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 ( CREATE TABLE t1 (
cont_nr int(11) NOT NULL auto_increment, cont_nr int(11) NOT NULL auto_increment,
ver_nr int(11) NOT NULL default '0', ver_nr int(11) NOT NULL default '0',
......
# #
# Test of alter table # Test of alter table
# #
--disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings
create table t1 ( create table t1 (
col1 int not null auto_increment primary key, col1 int not null auto_increment primary key,
col2 varchar(30) not null, col2 varchar(30) not null,
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# Test of procedure analyse # Test of procedure analyse
# #
--disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings
create table t1 (i int, j int); create table t1 (i int, j int);
insert into t1 values (1,2), (3,4), (5,6), (7,8); insert into t1 values (1,2), (3,4), (5,6), (7,8);
select * from t1 procedure analyse(); select * from t1 procedure analyse();
...@@ -10,4 +12,4 @@ create table t2 select * from t1 procedure analyse(); ...@@ -10,4 +12,4 @@ create table t2 select * from t1 procedure analyse();
select * from t2; select * from t2;
drop table t1,t2; drop table t1,t2;
EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE(); EXPLAIN SELECT 1 FROM (SELECT 1) a PROCEDURE ANALYSE();
\ No newline at end of file
# #
# Test of auto_increment; The test for BDB tables is in bdb.test # Test of auto_increment; The test for BDB tables is in bdb.test
# #
--disable_warnings
drop table if exists t1; 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; 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); insert into t1 values (1,1),(NULL,3),(NULL,4);
delete from t1 where a=4; delete from t1 where a=4;
......
...@@ -2,7 +2,9 @@ connect (con1,localhost,root,,); ...@@ -2,7 +2,9 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
connection con1; connection con1;
set SQL_LOG_BIN=0; 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); create table t1(n int);
--replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X" --replace_result "errno = 2" "errno = X" "errno = 22" "errno = X" "errno = 23" "errno = X"
backup table t1 to '../bogus'; backup table t1 to '../bogus';
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# Test of problem when shutting down mysqld at once after ALTER TABLE # Test of problem when shutting down mysqld at once after ALTER TABLE
# #
-- source include/have_bdb.inc -- source include/have_bdb.inc
--disable_warnings
drop table if exists t1; 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; 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(1, 't1',4,9);
insert into t1 values(2, 'metatable',1,9); insert into t1 values(2, 'metatable',1,9);
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# test for bug reported by Mark Steele # test for bug reported by Mark Steele
--disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warnings
CREATE TABLE t1 ( CREATE TABLE t1 (
ChargeID int(10) unsigned DEFAULT '0' NOT NULL auto_increment, ChargeID int(10) unsigned DEFAULT '0' NOT NULL auto_increment,
ServiceID int(10) unsigned DEFAULT '0' NOT NULL, ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings
connection con1; connection con1;
create table t1 (id integer, x integer) type=BDB; create table t1 (id integer, x integer) type=BDB;
create table t2 (id integer, x integer) type=BDB; create table t2 (id integer, x integer) type=BDB;
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
# Small basic test with ignore # Small basic test with ignore
# #
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8; 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; 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'); 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; ...@@ -441,7 +443,6 @@ drop table t1;
# This gave a wrong result because the row information was freed too early # 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 create table t1
( (
branch_id int auto_increment primary key, branch_id int auto_increment primary key,
...@@ -451,7 +452,6 @@ create table t1 ...@@ -451,7 +452,6 @@ create table t1
unique branch_name(branch_name), unique branch_name(branch_name),
index branch_active(branch_active) index branch_active(branch_active)
) type=bdb; ) type=bdb;
drop table if exists t2 ;
create table t2 create table t2
( (
target_id int auto_increment primary key, target_id int auto_increment primary key,
...@@ -461,7 +461,6 @@ create table t2 ...@@ -461,7 +461,6 @@ create table t2
unique target_name(target_name), unique target_name(target_name),
index target_active(target_active) index target_active(target_active)
) type=bdb; ) type=bdb;
drop table if exists t3 ;
create table t3 create table t3
( (
platform_id int auto_increment primary key, platform_id int auto_increment primary key,
...@@ -471,7 +470,6 @@ create table t3 ...@@ -471,7 +470,6 @@ create table t3
unique platform_name(platform_name), unique platform_name(platform_name),
index platform_active(platform_active) index platform_active(platform_active)
) type=bdb; ) type=bdb;
drop table if exists t4 ;
create table t4 create table t4
( (
product_id int auto_increment primary key, product_id int auto_increment primary key,
...@@ -482,7 +480,6 @@ create table t4 ...@@ -482,7 +480,6 @@ create table t4
unique product_name(product_name), unique product_name(product_name),
index product_active(product_active) index product_active(product_active)
) type=bdb; ) type=bdb;
drop table if exists t5 ;
create table t5 create table t5
( (
product_file_id int auto_increment primary key, product_file_id int auto_increment primary key,
...@@ -496,7 +493,6 @@ create table t5 ...@@ -496,7 +493,6 @@ create table t5
unique product_file(product_id,file_name), unique product_file(product_id,file_name),
index file_included(file_included) index file_included(file_included)
) type=bdb; ) type=bdb;
drop table if exists t6 ;
create table t6 create table t6
( (
file_platform_id int auto_increment primary key, file_platform_id int auto_increment primary key,
...@@ -510,7 +506,6 @@ create table t6 ...@@ -510,7 +506,6 @@ create table t6
unique file_platform(product_file_id,platform_id,branch_id) unique file_platform(product_file_id,platform_id,branch_id)
) type=bdb; ) type=bdb;
drop table if exists t8 ;
create table t8 create table t8
( (
archive_id int auto_increment primary key, archive_id int auto_increment primary key,
...@@ -523,7 +518,6 @@ create table t8 ...@@ -523,7 +518,6 @@ create table t8
unique archive(branch_id,target_id,platform_id,product_id), unique archive(branch_id,target_id,platform_id,product_id),
index status_id(status_id) index status_id(status_id)
) type=bdb; ) type=bdb;
drop table if exists t7 ;
create table t7 create table t7
( (
build_id int auto_increment primary key, build_id int auto_increment primary key,
...@@ -727,7 +721,6 @@ DROP TABLE t1,t2; ...@@ -727,7 +721,6 @@ DROP TABLE t1,t2;
# Test problem with joining table to itself on a multi-part unique key # 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; 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); insert into t1 values (1,1), (1,2);
select * from t1 where a = 1; select * from t1 where a = 1;
......
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
# #
# Without auto_commit. # Without auto_commit.
# #
--disable_warnings
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;
--enable_warnings
flush status; flush status;
set autocommit=0; set autocommit=0;
create table t1 (a int not null) type=bdb; create table t1 (a int not null) type=bdb;
......
#
# Test of count(distinct ..)
#
--disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warnings
create table t1(n int not null, key(n)) delay_key_write = 1; create table t1(n int not null, key(n)) delay_key_write = 1;
let $1=100; let $1=100;
disable_query_log; disable_query_log;
......
#
# Initialize
--disable_warnings
drop table if exists t1;
--enable_warnings
# #
# Test of reading of bigint values # Test of reading of bigint values
# #
...@@ -11,7 +18,6 @@ select +9999999999999999999,-9999999999999999999; ...@@ -11,7 +18,6 @@ select +9999999999999999999,-9999999999999999999;
# This will work on 4.0 as we then have internal handling of bigint variables. # 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)); create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE); insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1; select * from t1;
......
# #
# test sort,min and max on binary fields # test sort,min and max on binary fields
# #
--disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings
create table t1 (name char(20) not null, primary key (name)); create table t1 (name char(20) not null, primary key (name));
create table t2 (name char(20) binary not null, primary key (name)); create table t2 (name char(20) binary not null, primary key (name));
insert into t1 values (""); insert into t1 values ("");
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# Test of boolean operations with NULL # Test of boolean operations with NULL
# #
--disable_warnings
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
--enable_warnings
SELECT IF(NULL AND 1, 1, 2), IF(1 AND NULL, 1, 2); 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; SELECT NULL AND 1, 1 AND NULL, 0 AND NULL, NULL and 0;
...@@ -33,19 +35,17 @@ DROP TABLE t1; ...@@ -33,19 +35,17 @@ DROP TABLE t1;
# Read nA as !A, AB as A && B, AoB as A || B # Read nA as !A, AB as A && B, AoB as A || B
# Result table makes ANSI happy # Result table makes ANSI happy
drop table if exists t; create table t1 (a int, b int);
create table t(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);
insert into t 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 # 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 # 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 # This should work with any internal representation of True/False
# Result must be same as above # 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 t1;
drop table t;
# #
# this is a test of bulk-insert code # this is a test of bulk-insert code
# as used by REPLACE
#
# by Monty
# #
--disable_warnings
drop table if exists t1; 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)); 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); replace into t1 values (1,1,1),(2,2,2),(3,1,3);
select * from t1; select * from t1;
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# Testing of CASE # Testing of CASE
# #
--disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warnings
select CASE "b" when "a" then 1 when "b" then 2 END; select CASE "b" when "a" then 1 when "b" then 2 END;
select CASE "c" 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 (con1,localhost,root,,);
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
connection con1; connection con1;
--disable_warnings
drop table if exists t1; 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)); create table t1(n int not null, key(n), key(n), key(n), key(n));
let $1=10000; let $1=10000;
disable_query_log; disable_query_log;
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# Bug when using comparions of strings and integers. # Bug when using comparions of strings and integers.
# #
--disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warnings
CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id)); CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id));
insert into t1 values ('000000000001'),('000000000002'); insert into t1 values ('000000000001'),('000000000002');
explain select * from t1 where id=000000000001; explain select * from t1 where id=000000000001;
......
...@@ -41,7 +41,6 @@ show tables; ...@@ -41,7 +41,6 @@ show tables;
#--error 1045 #--error 1045
# check if old password version also works # check if old password version also works
update mysql.user set password=old_password("gambling2") where user="test"; update mysql.user set password=old_password("gambling2") where user="test";
flush privileges; flush privileges;
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
# Testing of constraints # Testing of constraints
# Currently MySQL only ignores the syntax. # Currently MySQL only ignores the syntax.
# #
--disable_warnings
drop table if exists t1; drop table if exists t1;
--enable_warnings
create table t1 (a int check (a>0)); create table t1 (a int check (a>0));
insert into t1 values (1); insert into t1 values (1);
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# Problem with count(distinct) # Problem with count(distinct)
# #
--disable_warnings
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
--enable_warnings
create table t1 (libname varchar(21) not null, city text, primary key (libname)); 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 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)); 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; drop table if exists t1;
--enable_warnings
create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text); create table t1(n1 int, n2 int, s char(20), vs varchar(20), t text);
insert into t1 values (1,11, 'one','eleven', 'eleven'), insert into t1 values (1,11, 'one','eleven', 'eleven'),
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
# Check some special create statements. # Check some special create statements.
# #
--disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings
create table t1 (b char(0)); create table t1 (b char(0));
insert into t1 values (""),(null); insert into t1 values (""),(null);
select * from t1; select * from t1;
...@@ -12,7 +15,7 @@ create table t1 (b char(0) not null); ...@@ -12,7 +15,7 @@ create table t1 (b char(0) not null);
create table if not exists t1 (b char(0) not null); create table if not exists t1 (b char(0) not null);
insert into t1 values (""),(null); insert into t1 values (""),(null);
select * from t1; select * from t1;
drop table if exists t1; drop table t1;
# #
# Test of some CREATE TABLE'S that should fail # Test of some CREATE TABLE'S that should fail
...@@ -91,11 +94,14 @@ create table t2 (a int) select * from t1; ...@@ -91,11 +94,14 @@ create table t2 (a int) select * from t1;
describe t1; describe t1;
describe t2; describe t2;
drop table if exists 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; 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; 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; drop table if exists t1,t2;
# #
...@@ -118,7 +124,6 @@ drop table if exists t1,t2; ...@@ -118,7 +124,6 @@ drop table if exists t1,t2;
# Test for CREATE TABLE .. LIKE .. # Test for CREATE TABLE .. LIKE ..
# #
drop table if exists t1, t2, t3;
create table t1(id int not null, name char(20)); create table t1(id int not null, name char(20));
insert into t1 values(10,'mysql'),(20,'monty- the creator'); insert into t1 values(10,'mysql'),(20,'monty- the creator');
create table t2(id int not null); 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