mirror of
https://github.com/MariaDB/server.git
synced 2025-11-16 20:23:18 +03:00
Merge mysql.com:/home/jonas/src/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0-ndb
This commit is contained in:
@@ -1107,3 +1107,6 @@ vio/test-sslclient
|
|||||||
vio/test-sslserver
|
vio/test-sslserver
|
||||||
vio/viotest-ssl
|
vio/viotest-ssl
|
||||||
VC++Files/client/mysql_amd64.dsp
|
VC++Files/client/mysql_amd64.dsp
|
||||||
|
client/mysqltestmanager-pwgen
|
||||||
|
client/mysqltestmanagerc
|
||||||
|
tools/mysqltestmanager
|
||||||
|
|||||||
9
BUILD/compile-pentium-cybozu
Executable file
9
BUILD/compile-pentium-cybozu
Executable file
@@ -0,0 +1,9 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
path=`dirname $0`
|
||||||
|
. "$path/SETUP.sh"
|
||||||
|
|
||||||
|
extra_flags="$pentium_cflags $fast_cflags -g"
|
||||||
|
extra_configs="$pentium_configs --with-charset=utf8 --with-collation=utf8_general_cs"
|
||||||
|
|
||||||
|
. "$path/FINISH.sh"
|
||||||
@@ -9,6 +9,7 @@ Sinisa@sinisa.nasamreza.org
|
|||||||
WAX@sergbook.mysql.com
|
WAX@sergbook.mysql.com
|
||||||
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
|
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
|
||||||
acurtis@pcgem.rdg.cyberkinetica.com
|
acurtis@pcgem.rdg.cyberkinetica.com
|
||||||
|
acurtis@xiphis.org
|
||||||
administrador@light.hegel.local
|
administrador@light.hegel.local
|
||||||
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
|
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
|
||||||
akishkin@work.mysql.com
|
akishkin@work.mysql.com
|
||||||
@@ -59,6 +60,7 @@ gerberb@ou800.zenez.com
|
|||||||
gluh@eagle.intranet.mysql.r18.ru
|
gluh@eagle.intranet.mysql.r18.ru
|
||||||
gluh@gluh.(none)
|
gluh@gluh.(none)
|
||||||
gluh@gluh.mysql.r18.ru
|
gluh@gluh.mysql.r18.ru
|
||||||
|
gluh@mysql.com
|
||||||
gordon@zero.local.lan
|
gordon@zero.local.lan
|
||||||
greg@gcw.ath.cx
|
greg@gcw.ath.cx
|
||||||
greg@mysql.com
|
greg@mysql.com
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
|
||||||
|
CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet`
|
||||||
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
|
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'`
|
||||||
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'`
|
||||||
|
|
||||||
@@ -52,6 +53,7 @@ List-ID: <bk.mysql-$VERSION>
|
|||||||
From: $FROM
|
From: $FROM
|
||||||
To: $TO
|
To: $TO
|
||||||
Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL}
|
Subject: bk commit - $VERSION tree ($CHANGESET)${BS}${WL}
|
||||||
|
X-CSetKey: <$CSETKEY>
|
||||||
$BH
|
$BH
|
||||||
EOF
|
EOF
|
||||||
bk changes -v -r+
|
bk changes -v -r+
|
||||||
@@ -68,6 +70,7 @@ List-ID: <bk.mysql-$VERSION>
|
|||||||
From: $FROM
|
From: $FROM
|
||||||
To: $INTERNALS
|
To: $INTERNALS
|
||||||
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
|
Subject: bk commit into $VERSION tree ($CHANGESET)$BS
|
||||||
|
X-CSetKey: <$CSETKEY>
|
||||||
$BH
|
$BH
|
||||||
Below is the list of changes that have just been committed into a local
|
Below is the list of changes that have just been committed into a local
|
||||||
$VERSION repository of $USER. When $USER does a push these changes will
|
$VERSION repository of $USER. When $USER does a push these changes will
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ SOURCE="..\strings\ctype-bin.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-cp932.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-czech.c"
|
SOURCE="..\strings\ctype-czech.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -155,6 +159,10 @@ SOURCE="..\strings\ctype-euc_kr.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-eucjpms.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-extra.c"
|
SOURCE="..\strings\ctype-extra.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ SOURCE="..\strings\ctype-bin.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-cp932.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-czech.c"
|
SOURCE="..\strings\ctype-czech.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -155,6 +159,10 @@ SOURCE="..\strings\ctype-euc_kr.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-eucjpms.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-extra.c"
|
SOURCE="..\strings\ctype-extra.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -139,6 +139,10 @@ SOURCE="..\strings\ctype-bin.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-cp932.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-czech.c"
|
SOURCE="..\strings\ctype-czech.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -147,6 +151,10 @@ SOURCE="..\strings\ctype-euc_kr.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-eucjpms.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-extra.c"
|
SOURCE="..\strings\ctype-extra.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -138,6 +138,10 @@ SOURCE="..\strings\ctype-bin.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-cp932.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-czech.c"
|
SOURCE="..\strings\ctype-czech.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -146,6 +150,10 @@ SOURCE="..\strings\ctype-euc_kr.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE="..\strings\ctype-eucjpms.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE="..\strings\ctype-extra.c"
|
SOURCE="..\strings\ctype-extra.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -113,10 +113,18 @@ SOURCE=".\ctype-bin.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\ctype-cp932.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=".\ctype-czech.c"
|
SOURCE=".\ctype-czech.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\ctype-eucjpms.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=".\ctype-euc_kr.c"
|
SOURCE=".\ctype-euc_kr.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -112,6 +112,10 @@ SOURCE=".\ctype-bin.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\ctype-cp932.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=".\ctype-czech.c"
|
SOURCE=".\ctype-czech.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
@@ -120,6 +124,10 @@ SOURCE=".\ctype-euc_kr.c"
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=".\ctype-eucjpms.c"
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=".\ctype-extra.c"
|
SOURCE=".\ctype-extra.c"
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|||||||
@@ -566,6 +566,7 @@ static void print_result()
|
|||||||
my_bool found_error=0;
|
my_bool found_error=0;
|
||||||
|
|
||||||
res = mysql_use_result(sock);
|
res = mysql_use_result(sock);
|
||||||
|
|
||||||
prev[0] = '\0';
|
prev[0] = '\0';
|
||||||
for (i = 0; (row = mysql_fetch_row(res)); i++)
|
for (i = 0; (row = mysql_fetch_row(res)); i++)
|
||||||
{
|
{
|
||||||
@@ -595,7 +596,7 @@ static void print_result()
|
|||||||
putchar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
|
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
|
||||||
(!opt_fast || strcmp(row[3],"OK")))
|
!opt_fast)
|
||||||
insert_dynamic(&tables4repair, prev);
|
insert_dynamic(&tables4repair, prev);
|
||||||
mysql_free_result(res);
|
mysql_free_result(res);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
|
|||||||
Q_START_TIMER, Q_END_TIMER,
|
Q_START_TIMER, Q_END_TIMER,
|
||||||
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
|
Q_CHARACTER_SET, Q_DISABLE_PS_PROTOCOL, Q_ENABLE_PS_PROTOCOL,
|
||||||
Q_EXIT,
|
Q_EXIT,
|
||||||
|
Q_DISABLE_RECONNECT, Q_ENABLE_RECONNECT,
|
||||||
|
|
||||||
Q_UNKNOWN, /* Unknown command. */
|
Q_UNKNOWN, /* Unknown command. */
|
||||||
Q_COMMENT, /* Comments, ignored. */
|
Q_COMMENT, /* Comments, ignored. */
|
||||||
@@ -382,6 +383,8 @@ const char *command_names[]=
|
|||||||
"disable_ps_protocol",
|
"disable_ps_protocol",
|
||||||
"enable_ps_protocol",
|
"enable_ps_protocol",
|
||||||
"exit",
|
"exit",
|
||||||
|
"disable_reconnect",
|
||||||
|
"enable_reconnect",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -642,6 +645,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname)
|
|||||||
{
|
{
|
||||||
DBUG_PRINT("info",("Size differs: result size: %u file size: %u",
|
DBUG_PRINT("info",("Size differs: result size: %u file size: %u",
|
||||||
ds->length, stat_info.st_size));
|
ds->length, stat_info.st_size));
|
||||||
|
DBUG_PRINT("info",("result: '%s'", ds->str));
|
||||||
DBUG_RETURN(2);
|
DBUG_RETURN(2);
|
||||||
}
|
}
|
||||||
if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME))))
|
if (!(tmp = (char*) my_malloc(stat_info.st_size + 1, MYF(MY_WME))))
|
||||||
@@ -3620,8 +3624,8 @@ static void init_var_hash(MYSQL *mysql)
|
|||||||
if (hash_init(&var_hash, charset_info,
|
if (hash_init(&var_hash, charset_info,
|
||||||
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
||||||
die("Variable hash initialization failed");
|
die("Variable hash initialization failed");
|
||||||
if (opt_big_test)
|
my_hash_insert(&var_hash, (byte*) var_init(0,"BIG_TEST", 0,
|
||||||
my_hash_insert(&var_hash, (byte*) var_init(0,"BIG_TEST", 0, "1",0));
|
(opt_big_test) ? "1" : "0", 0));
|
||||||
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
|
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
|
||||||
my_hash_insert(&var_hash, (byte*) v);
|
my_hash_insert(&var_hash, (byte*) v);
|
||||||
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
|
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
|
||||||
@@ -3790,6 +3794,12 @@ int main(int argc, char **argv)
|
|||||||
if (q->query == q->query_buf)
|
if (q->query == q->query_buf)
|
||||||
q->query += q->first_word_len + 1;
|
q->query += q->first_word_len + 1;
|
||||||
display_result_vertically= (q->type==Q_QUERY_VERTICAL);
|
display_result_vertically= (q->type==Q_QUERY_VERTICAL);
|
||||||
|
if (save_file[0])
|
||||||
|
{
|
||||||
|
strmov(q->record_file,save_file);
|
||||||
|
q->require_file=require_file;
|
||||||
|
save_file[0]=0;
|
||||||
|
}
|
||||||
error|= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND);
|
error|= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND);
|
||||||
display_result_vertically= old_display_result_vertically;
|
display_result_vertically= old_display_result_vertically;
|
||||||
break;
|
break;
|
||||||
@@ -3895,6 +3905,12 @@ int main(int argc, char **argv)
|
|||||||
case Q_ENABLE_PS_PROTOCOL:
|
case Q_ENABLE_PS_PROTOCOL:
|
||||||
ps_protocol_enabled= ps_protocol;
|
ps_protocol_enabled= ps_protocol;
|
||||||
break;
|
break;
|
||||||
|
case Q_DISABLE_RECONNECT:
|
||||||
|
cur_con->mysql.reconnect= 0;
|
||||||
|
break;
|
||||||
|
case Q_ENABLE_RECONNECT:
|
||||||
|
cur_con->mysql.reconnect= 1;
|
||||||
|
break;
|
||||||
|
|
||||||
case Q_EXIT:
|
case Q_EXIT:
|
||||||
abort_flag= 1;
|
abort_flag= 1;
|
||||||
|
|||||||
@@ -359,16 +359,23 @@ case $default_charset in
|
|||||||
;;
|
;;
|
||||||
utf8)
|
utf8)
|
||||||
default_charset_default_collation="utf8_general_ci"
|
default_charset_default_collation="utf8_general_ci"
|
||||||
define(UTFC1, utf8_general_ci utf8_bin)
|
if test "$default_collation" = "utf8_general_cs"; then
|
||||||
define(UTFC2, utf8_czech_ci utf8_danish_ci)
|
# For those who explicitly desire "utf8_general_cs", support it,
|
||||||
define(UTFC3, utf8_estonian_ci utf8_icelandic_ci)
|
# and then also set the CPP switch enabling that code.
|
||||||
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
|
UTFC="utf8_general_cs"
|
||||||
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
|
AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer])
|
||||||
define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
|
else
|
||||||
define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
|
define(UTFC1, utf8_general_ci utf8_bin)
|
||||||
define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
|
define(UTFC2, utf8_czech_ci utf8_danish_ci)
|
||||||
define(UTFC9, utf8_unicode_ci)
|
define(UTFC3, utf8_estonian_ci utf8_icelandic_ci)
|
||||||
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
|
define(UTFC4, utf8_latvian_ci utf8_lithuanian_ci)
|
||||||
|
define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci)
|
||||||
|
define(UTFC6, utf8_slovak_ci utf8_slovenian_ci)
|
||||||
|
define(UTFC7, utf8_spanish2_ci utf8_spanish_ci)
|
||||||
|
define(UTFC8, utf8_swedish_ci utf8_turkish_ci)
|
||||||
|
define(UTFC9, utf8_unicode_ci)
|
||||||
|
UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9"
|
||||||
|
fi
|
||||||
default_charset_collations="$UTFC"
|
default_charset_collations="$UTFC"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
AC_DEFUN([MYSQL_CHECK_ISAM], [
|
|
||||||
AC_ARG_WITH([isam], [
|
|
||||||
--with-isam Enable the ISAM table type],
|
|
||||||
[with_isam="$withval"],
|
|
||||||
[with_isam=no])
|
|
||||||
|
|
||||||
isam_libs=
|
|
||||||
if test X"$with_isam" = X"yes"
|
|
||||||
then
|
|
||||||
AC_DEFINE([HAVE_ISAM], [1], [Using old ISAM tables])
|
|
||||||
isam_libs="\$(top_builddir)/isam/libnisam.a\
|
|
||||||
\$(top_builddir)/merge/libmerge.a"
|
|
||||||
fi
|
|
||||||
AC_SUBST(isam_libs)
|
|
||||||
])
|
|
||||||
12
configure.in
12
configure.in
@@ -6,7 +6,7 @@ AC_PREREQ(2.50)dnl Minimum Autoconf version required.
|
|||||||
AC_INIT(sql/mysqld.cc)
|
AC_INIT(sql/mysqld.cc)
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
# Don't forget to also update the NDB lines below.
|
# Don't forget to also update the NDB lines below.
|
||||||
AM_INIT_AUTOMAKE(mysql, 5.0.4-beta)
|
AM_INIT_AUTOMAKE(mysql, 5.0.5-beta)
|
||||||
AM_CONFIG_HEADER(config.h)
|
AM_CONFIG_HEADER(config.h)
|
||||||
|
|
||||||
PROTOCOL_VERSION=10
|
PROTOCOL_VERSION=10
|
||||||
@@ -41,7 +41,6 @@ sinclude(config/ac-macros/ha_blackhole.m4)
|
|||||||
sinclude(config/ac-macros/ha_example.m4)
|
sinclude(config/ac-macros/ha_example.m4)
|
||||||
sinclude(config/ac-macros/ha_federated.m4)
|
sinclude(config/ac-macros/ha_federated.m4)
|
||||||
sinclude(config/ac-macros/ha_innodb.m4)
|
sinclude(config/ac-macros/ha_innodb.m4)
|
||||||
sinclude(config/ac-macros/ha_isam.m4)
|
|
||||||
sinclude(config/ac-macros/ha_ndbcluster.m4)
|
sinclude(config/ac-macros/ha_ndbcluster.m4)
|
||||||
sinclude(config/ac-macros/ha_tina.m4)
|
sinclude(config/ac-macros/ha_tina.m4)
|
||||||
sinclude(config/ac-macros/large_file.m4)
|
sinclude(config/ac-macros/large_file.m4)
|
||||||
@@ -352,6 +351,15 @@ then
|
|||||||
if echo $CXX | grep gcc > /dev/null 2>&1
|
if echo $CXX | grep gcc > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
GCC_VERSION=`gcc -v 2>&1 | grep version | sed -e 's/[[^0-9. ]]//g; s/^ *//g; s/ .*//g'`
|
GCC_VERSION=`gcc -v 2>&1 | grep version | sed -e 's/[[^0-9. ]]//g; s/^ *//g; s/ .*//g'`
|
||||||
|
case $SYSTEM_TYPE in
|
||||||
|
*freebsd*)
|
||||||
|
# The libsupc++ library on freebsd with gcc 3.4.2 is dependent on
|
||||||
|
# libstdc++, disable it since other solution works fine
|
||||||
|
GCC_VERSION="NOSUPCPP_$GCC_VERSION"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
echo "Using gcc version '$GCC_VERSION'"
|
echo "Using gcc version '$GCC_VERSION'"
|
||||||
case "$GCC_VERSION" in
|
case "$GCC_VERSION" in
|
||||||
3.4.*|3.5.*)
|
3.4.*|3.5.*)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \
|
|||||||
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
|
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
|
||||||
mysql_time.h $(BUILT_SOURCES)
|
mysql_time.h $(BUILT_SOURCES)
|
||||||
noinst_HEADERS = config-win.h config-os2.h config-netware.h \
|
noinst_HEADERS = config-win.h config-os2.h config-netware.h \
|
||||||
nisam.h heap.h merge.h my_bitmap.h\
|
heap.h my_bitmap.h\
|
||||||
myisam.h myisampack.h myisammrg.h ft_global.h\
|
myisam.h myisampack.h myisammrg.h ft_global.h\
|
||||||
mysys_err.h my_base.h help_start.h help_end.h \
|
mysys_err.h my_base.h help_start.h help_end.h \
|
||||||
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
|
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
|
||||||
|
|||||||
@@ -351,7 +351,6 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||||
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||||
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
|
#define thread_safe_decrement(V,L) InterlockedDecrement((long*) &(V))
|
||||||
#define thread_safe_dec_and_test(V, L) thread_safe_decrement(V,L)
|
|
||||||
/* The following is only used for statistics, so it should be good enough */
|
/* The following is only used for statistics, so it should be good enough */
|
||||||
#ifdef __NT__ /* This should also work on Win98 but .. */
|
#ifdef __NT__ /* This should also work on Win98 but .. */
|
||||||
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
||||||
@@ -379,6 +378,7 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
/* #undef HAVE_CHARSET_armscii8 */
|
/* #undef HAVE_CHARSET_armscii8 */
|
||||||
/* #undef HAVE_CHARSET_ascii */
|
/* #undef HAVE_CHARSET_ascii */
|
||||||
#define HAVE_CHARSET_big5 1
|
#define HAVE_CHARSET_big5 1
|
||||||
|
#define HAVE_CHARSET_cp932
|
||||||
#define HAVE_CHARSET_cp1250 1
|
#define HAVE_CHARSET_cp1250 1
|
||||||
/* #undef HAVE_CHARSET_cp1251 */
|
/* #undef HAVE_CHARSET_cp1251 */
|
||||||
/* #undef HAVE_CHARSET_cp1256 */
|
/* #undef HAVE_CHARSET_cp1256 */
|
||||||
@@ -387,6 +387,7 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
/* #undef HAVE_CHARSET_cp852 */
|
/* #undef HAVE_CHARSET_cp852 */
|
||||||
/* #undef HAVE_CHARSET_cp866 */
|
/* #undef HAVE_CHARSET_cp866 */
|
||||||
/* #undef HAVE_CHARSET_dec8 */
|
/* #undef HAVE_CHARSET_dec8 */
|
||||||
|
#define HAVE_CHARSET_eucjpms 1
|
||||||
#define HAVE_CHARSET_euckr 1
|
#define HAVE_CHARSET_euckr 1
|
||||||
#define HAVE_CHARSET_gb2312 1
|
#define HAVE_CHARSET_gb2312 1
|
||||||
#define HAVE_CHARSET_gbk 1
|
#define HAVE_CHARSET_gbk 1
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ typedef struct my_charset_handler_st
|
|||||||
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
|
||||||
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
|
||||||
uint (*well_formed_len)(struct charset_info_st *,
|
uint (*well_formed_len)(struct charset_info_st *,
|
||||||
const char *b,const char *e, uint nchars);
|
const char *b,const char *e,
|
||||||
|
uint nchars, int *error);
|
||||||
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
|
||||||
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
|
uint (*numcells)(struct charset_info_st *, const char *b, const char *e);
|
||||||
|
|
||||||
@@ -186,7 +187,7 @@ typedef struct my_charset_handler_st
|
|||||||
int base, char **e, int *err);
|
int base, char **e, int *err);
|
||||||
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
|
double (*strntod)(struct charset_info_st *, char *s, uint l, char **e,
|
||||||
int *err);
|
int *err);
|
||||||
longlong (*my_strtoll10)(struct charset_info_st *cs,
|
longlong (*strtoll10)(struct charset_info_st *cs,
|
||||||
const char *nptr, char **endptr, int *error);
|
const char *nptr, char **endptr, int *error);
|
||||||
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
ulong (*scan)(struct charset_info_st *, const char *b, const char *e,
|
||||||
int sq);
|
int sq);
|
||||||
@@ -349,7 +350,8 @@ int my_wildcmp_8bit(CHARSET_INFO *,
|
|||||||
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||||
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
|
||||||
|
uint pos, int *error);
|
||||||
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
|
||||||
|
|
||||||
|
|
||||||
@@ -367,7 +369,8 @@ int my_wildcmp_mb(CHARSET_INFO *,
|
|||||||
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
|
uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
|
||||||
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
||||||
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
|
uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
|
||||||
|
uint pos, int *error);
|
||||||
uint my_instr_mb(struct charset_info_st *,
|
uint my_instr_mb(struct charset_info_st *,
|
||||||
const char *b, uint b_length,
|
const char *b, uint b_length,
|
||||||
const char *s, uint s_length,
|
const char *s, uint s_length,
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
/* Copyright (C) 2000 MySQL AB
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
||||||
|
|
||||||
/* This file should be included when using merge_isam_funktions */
|
|
||||||
/* Author: Michael Widenius */
|
|
||||||
|
|
||||||
#ifndef _merge_h
|
|
||||||
#define _merge_h
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _my_base_h
|
|
||||||
#include <my_base.h>
|
|
||||||
#endif
|
|
||||||
#ifndef _nisam_h
|
|
||||||
#include <nisam.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MRG_NAME_EXT ".MRG"
|
|
||||||
|
|
||||||
/* Param to/from mrg_info */
|
|
||||||
|
|
||||||
typedef struct st_mrg_info /* Struct from h_info */
|
|
||||||
{
|
|
||||||
ulonglong records; /* Records in database */
|
|
||||||
ulonglong deleted; /* Deleted records in database */
|
|
||||||
ulonglong recpos; /* Pos for last used record */
|
|
||||||
ulonglong data_file_length;
|
|
||||||
uint reclength; /* Recordlength */
|
|
||||||
int errkey; /* With key was dupplicated on err */
|
|
||||||
uint options; /* HA_OPTION_... used */
|
|
||||||
} MERGE_INFO;
|
|
||||||
|
|
||||||
typedef struct st_mrg_table_info
|
|
||||||
{
|
|
||||||
N_INFO *table;
|
|
||||||
ulonglong file_offset;
|
|
||||||
} MRG_TABLE;
|
|
||||||
|
|
||||||
typedef struct st_merge
|
|
||||||
{
|
|
||||||
MRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
|
|
||||||
ulonglong records; /* records in tables */
|
|
||||||
ulonglong del; /* Removed records */
|
|
||||||
ulonglong data_file_length;
|
|
||||||
uint tables,options,reclength;
|
|
||||||
my_bool cache_in_use;
|
|
||||||
LIST open_list;
|
|
||||||
} MRG_INFO;
|
|
||||||
|
|
||||||
typedef ulong mrg_off_t;
|
|
||||||
|
|
||||||
/* Prototypes for merge-functions */
|
|
||||||
|
|
||||||
extern int mrg_close(MRG_INFO *file);
|
|
||||||
extern int mrg_delete(MRG_INFO *file,const byte *buff);
|
|
||||||
extern MRG_INFO *mrg_open(const char *name,int mode,int wait_if_locked);
|
|
||||||
extern int mrg_panic(enum ha_panic_function function);
|
|
||||||
extern int mrg_rfirst(MRG_INFO *file,byte *buf,int inx);
|
|
||||||
extern int mrg_rkey(MRG_INFO *file,byte *buf,int inx,const byte *key,
|
|
||||||
uint key_len, enum ha_rkey_function search_flag);
|
|
||||||
extern int mrg_rrnd(MRG_INFO *file,byte *buf, mrg_off_t pos);
|
|
||||||
extern int mrg_rsame(MRG_INFO *file,byte *record,int inx);
|
|
||||||
extern int mrg_update(MRG_INFO *file,const byte *old,const byte *new_rec);
|
|
||||||
extern int mrg_info(MRG_INFO *file,MERGE_INFO *x,int flag);
|
|
||||||
extern int mrg_lock_database(MRG_INFO *file,int lock_type);
|
|
||||||
extern int mrg_create(const char *name,const char **table_names);
|
|
||||||
extern int mrg_extra(MRG_INFO *file,enum ha_extra_function function);
|
|
||||||
extern ha_rows mrg_records_in_range(MRG_INFO *info,int inx,
|
|
||||||
const byte *start_key,uint start_key_len,
|
|
||||||
enum ha_rkey_function start_search_flag,
|
|
||||||
const byte *end_key,uint end_key_len,
|
|
||||||
enum ha_rkey_function end_search_flag);
|
|
||||||
|
|
||||||
extern mrg_off_t mrg_position(MRG_INFO *info);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
@@ -312,7 +312,9 @@ enum ha_base_keytype {
|
|||||||
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
|
#define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */
|
||||||
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
|
#define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */
|
||||||
#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
|
#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */
|
||||||
#define HA_ERR_LAST 158 /*Copy last error nr.*/
|
#define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */
|
||||||
|
|
||||||
|
#define HA_ERR_LAST 159 /*Copy last error nr.*/
|
||||||
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
|
/* Add error numbers before HA_ERR_LAST and change it accordingly. */
|
||||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||||
|
|
||||||
|
|||||||
@@ -678,7 +678,6 @@ extern pthread_t shutdown_th, main_th, signal_th;
|
|||||||
#ifdef HAVE_ATOMIC_ADD
|
#ifdef HAVE_ATOMIC_ADD
|
||||||
#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
|
#define thread_safe_increment(V,L) atomic_inc((atomic_t*) &V)
|
||||||
#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
|
#define thread_safe_decrement(V,L) atomic_dec((atomic_t*) &V)
|
||||||
#define thread_safe_dec_and_test(V, L) atomic_dec_and_test((atomic_t*) &V)
|
|
||||||
#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V)
|
#define thread_safe_add(V,C,L) atomic_add((C),(atomic_t*) &V)
|
||||||
#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V)
|
#define thread_safe_sub(V,C,L) atomic_sub((C),(atomic_t*) &V)
|
||||||
#else
|
#else
|
||||||
@@ -689,22 +688,6 @@ extern pthread_t shutdown_th, main_th, signal_th;
|
|||||||
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
|
#define thread_safe_add(V,C,L) (pthread_mutex_lock((L)), (V)+=(C), pthread_mutex_unlock((L)))
|
||||||
#define thread_safe_sub(V,C,L) \
|
#define thread_safe_sub(V,C,L) \
|
||||||
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
|
(pthread_mutex_lock((L)), (V)-=(C), pthread_mutex_unlock((L)))
|
||||||
#ifdef __cplusplus
|
|
||||||
static inline bool thread_safe_dec_and_test(ulong &V, pthread_mutex_t *L)
|
|
||||||
{
|
|
||||||
ulong res;
|
|
||||||
pthread_mutex_lock(L);
|
|
||||||
res=--V;
|
|
||||||
pthread_mutex_unlock(L);
|
|
||||||
return res==0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
/*
|
|
||||||
what should we do ? define it as static ?
|
|
||||||
a regular function somewhere in mysys/ ?
|
|
||||||
for now it's only used in c++ code, so there's no need to bother
|
|
||||||
*/
|
|
||||||
#endif
|
|
||||||
#endif /* HAVE_ATOMIC_ADD */
|
#endif /* HAVE_ATOMIC_ADD */
|
||||||
#ifdef SAFE_STATISTICS
|
#ifdef SAFE_STATISTICS
|
||||||
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
||||||
|
|||||||
@@ -54,11 +54,10 @@ extern int NEAR my_errno; /* Last error in mysys */
|
|||||||
#define MY_FAE 8 /* Fatal if any error */
|
#define MY_FAE 8 /* Fatal if any error */
|
||||||
#define MY_WME 16 /* Write message on error */
|
#define MY_WME 16 /* Write message on error */
|
||||||
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
|
#define MY_WAIT_IF_FULL 32 /* Wait and try again if disk full error */
|
||||||
#define MY_RAID 64 /* Support for RAID (not the "Johnson&Johnson"-s one ;) */
|
#define MY_IGNORE_BADFD 32 /* my_sync: ignore 'bad descriptor' errors */
|
||||||
#define MY_FULL_IO 512 /* For my_read - loop intil I/O
|
#define MY_RAID 64 /* Support for RAID */
|
||||||
is complete
|
#define MY_FULL_IO 512 /* For my_read - loop intil I/O is complete */
|
||||||
*/
|
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
|
||||||
#define MY_DONT_CHECK_FILESIZE 128 /* Option to init_io_cache() */
|
|
||||||
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
|
#define MY_LINK_WARNING 32 /* my_redel() gives warning if links */
|
||||||
#define MY_COPYTIME 64 /* my_redel() copys time */
|
#define MY_COPYTIME 64 /* my_redel() copys time */
|
||||||
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
|
#define MY_DELETE_OLD 256 /* my_create_with_symlink() */
|
||||||
@@ -72,7 +71,7 @@ extern int NEAR my_errno; /* Last error in mysys */
|
|||||||
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
|
#define MY_FREE_ON_ERROR 128 /* my_realloc() ; Free old ptr on error */
|
||||||
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
|
#define MY_HOLD_ON_ERROR 256 /* my_realloc() ; Return old ptr on error */
|
||||||
#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
|
#define MY_THREADSAFE 128 /* pread/pwrite: Don't allow interrupts */
|
||||||
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy; Don't overwrite file */
|
#define MY_DONT_OVERWRITE_FILE 1024 /* my_copy: Don't overwrite file */
|
||||||
|
|
||||||
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
|
#define MY_CHECK_ERROR 1 /* Params to my_end; Check open-close */
|
||||||
#define MY_GIVE_INFO 2 /* Give time info about process*/
|
#define MY_GIVE_INFO 2 /* Give time info about process*/
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#undef HAVE_PSTACK /* No stacktrace */
|
#undef HAVE_PSTACK /* No stacktrace */
|
||||||
#undef HAVE_DLOPEN /* No udf functions */
|
#undef HAVE_DLOPEN /* No udf functions */
|
||||||
#undef HAVE_OPENSSL
|
#undef HAVE_OPENSSL
|
||||||
#undef HAVE_ISAM
|
|
||||||
#undef HAVE_SMEM /* No shared memory */
|
#undef HAVE_SMEM /* No shared memory */
|
||||||
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */
|
||||||
|
|
||||||
|
|||||||
212
include/nisam.h
212
include/nisam.h
@@ -1,212 +0,0 @@
|
|||||||
/* Copyright (C) 2000 MySQL AB
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
||||||
|
|
||||||
/* This file should be included when using nisam_funktions */
|
|
||||||
/* Author: Michael Widenius */
|
|
||||||
|
|
||||||
#ifndef _nisam_h
|
|
||||||
#define _nisam_h
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _my_base_h
|
|
||||||
#include <my_base.h>
|
|
||||||
#endif
|
|
||||||
/* defines used by nisam-funktions */
|
|
||||||
|
|
||||||
#define N_MAXKEY 16 /* Max allowed keys */
|
|
||||||
#define N_MAXKEY_SEG 16 /* Max segments for key */
|
|
||||||
#define N_MAX_KEY_LENGTH 256 /* May be increased up to 500 */
|
|
||||||
#define N_MAX_KEY_BUFF (N_MAX_KEY_LENGTH+N_MAXKEY_SEG+sizeof(double)-1)
|
|
||||||
#define N_MAX_POSSIBLE_KEY_BUFF 500+9
|
|
||||||
|
|
||||||
#define N_NAME_IEXT ".ISM"
|
|
||||||
#define N_NAME_DEXT ".ISD"
|
|
||||||
#define NI_POS_ERROR (~ (ulong) 0)
|
|
||||||
|
|
||||||
|
|
||||||
/* Param to/from nisam_info */
|
|
||||||
|
|
||||||
typedef struct st_n_isaminfo /* Struct from h_info */
|
|
||||||
{
|
|
||||||
ulong records; /* Records in database */
|
|
||||||
ulong deleted; /* Deleted records in database */
|
|
||||||
ulong recpos; /* Pos for last used record */
|
|
||||||
ulong newrecpos; /* Pos if we write new record */
|
|
||||||
ulong dupp_key_pos; /* Position to record with dupp key */
|
|
||||||
ulong data_file_length, /* Length of data file */
|
|
||||||
max_data_file_length,
|
|
||||||
index_file_length,
|
|
||||||
max_index_file_length,
|
|
||||||
delete_length;
|
|
||||||
uint reclength; /* Recordlength */
|
|
||||||
uint mean_reclength; /* Mean recordlength (if packed) */
|
|
||||||
uint keys; /* How many keys used */
|
|
||||||
uint options; /* HA_OPTION_... used */
|
|
||||||
int errkey, /* With key was dupplicated on err */
|
|
||||||
sortkey; /* clustered by this key */
|
|
||||||
File filenr; /* (uniq) filenr for datafile */
|
|
||||||
time_t create_time; /* When table was created */
|
|
||||||
time_t isamchk_time;
|
|
||||||
time_t update_time;
|
|
||||||
ulong *rec_per_key; /* for sql optimizing */
|
|
||||||
} N_ISAMINFO;
|
|
||||||
|
|
||||||
|
|
||||||
/* Info saved on file for each info-part */
|
|
||||||
|
|
||||||
#ifdef __WATCOMC__
|
|
||||||
#pragma pack(2)
|
|
||||||
#define uint uint16 /* Same format as in MSDOS */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __ZTC__
|
|
||||||
#pragma ZTC align 2
|
|
||||||
#define uint uint16 /* Same format as in MSDOS */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct st_n_save_keyseg /* Key-portion */
|
|
||||||
{
|
|
||||||
uint8 type; /* Typ av nyckel (f|r sort) */
|
|
||||||
uint8 flag; /* HA_DIFF_LENGTH */
|
|
||||||
uint16 start; /* Start of key in record */
|
|
||||||
uint16 length; /* Keylength */
|
|
||||||
} N_SAVE_KEYSEG;
|
|
||||||
|
|
||||||
typedef struct st_n_save_keydef /* Key definition with create & info */
|
|
||||||
{
|
|
||||||
uint8 flag; /* NOSAME, PACK_USED */
|
|
||||||
uint8 keysegs; /* Number of key-segment */
|
|
||||||
uint16 block_length; /* Length of keyblock (auto) */
|
|
||||||
uint16 keylength; /* Tot length of keyparts (auto) */
|
|
||||||
uint16 minlength; /* min length of (packed) key (auto) */
|
|
||||||
uint16 maxlength; /* max length of (packed) key (auto) */
|
|
||||||
} N_SAVE_KEYDEF;
|
|
||||||
|
|
||||||
typedef struct st_n_save_recinfo /* Info of record */
|
|
||||||
{
|
|
||||||
int16 type; /* en_fieldtype */
|
|
||||||
uint16 length; /* length of field */
|
|
||||||
} N_SAVE_RECINFO;
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __ZTC__
|
|
||||||
#pragma ZTC align
|
|
||||||
#undef uint
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __WATCOMC__
|
|
||||||
#pragma pack()
|
|
||||||
#undef uint
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
struct st_isam_info; /* For referense */
|
|
||||||
|
|
||||||
#ifndef ISAM_LIBRARY
|
|
||||||
typedef struct st_isam_info N_INFO;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct st_n_keyseg /* Key-portion */
|
|
||||||
{
|
|
||||||
N_SAVE_KEYSEG base;
|
|
||||||
} N_KEYSEG;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct st_n_keydef /* Key definition with open & info */
|
|
||||||
{
|
|
||||||
N_SAVE_KEYDEF base;
|
|
||||||
N_KEYSEG seg[N_MAXKEY_SEG+1];
|
|
||||||
int (*bin_search)(struct st_isam_info *info,struct st_n_keydef *keyinfo,
|
|
||||||
uchar *page,uchar *key,
|
|
||||||
uint key_len,uint comp_flag,uchar * *ret_pos,
|
|
||||||
uchar *buff);
|
|
||||||
uint (*get_key)(struct st_n_keydef *keyinfo,uint nod_flag,uchar * *page,
|
|
||||||
uchar *key);
|
|
||||||
} N_KEYDEF;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct st_decode_tree /* Decode huff-table */
|
|
||||||
{
|
|
||||||
uint16 *table;
|
|
||||||
uint quick_table_bits;
|
|
||||||
byte *intervalls;
|
|
||||||
} DECODE_TREE;
|
|
||||||
|
|
||||||
|
|
||||||
struct st_bit_buff;
|
|
||||||
|
|
||||||
typedef struct st_n_recinfo /* Info of record */
|
|
||||||
{
|
|
||||||
N_SAVE_RECINFO base;
|
|
||||||
#ifndef NOT_PACKED_DATABASES
|
|
||||||
void (*unpack)(struct st_n_recinfo *rec,struct st_bit_buff *buff,
|
|
||||||
uchar *start,uchar *end);
|
|
||||||
enum en_fieldtype base_type;
|
|
||||||
uint space_length_bits,pack_type;
|
|
||||||
DECODE_TREE *huff_tree;
|
|
||||||
#endif
|
|
||||||
} N_RECINFO;
|
|
||||||
|
|
||||||
|
|
||||||
extern my_string nisam_log_filename; /* Name of logfile */
|
|
||||||
extern uint nisam_block_size;
|
|
||||||
extern my_bool nisam_flush;
|
|
||||||
|
|
||||||
/* Prototypes for nisam-functions */
|
|
||||||
|
|
||||||
extern int nisam_close(struct st_isam_info *file);
|
|
||||||
extern int nisam_delete(struct st_isam_info *file,const byte *buff);
|
|
||||||
extern struct st_isam_info *nisam_open(const char *name,int mode,
|
|
||||||
uint wait_if_locked);
|
|
||||||
extern int nisam_panic(enum ha_panic_function function);
|
|
||||||
extern int nisam_rfirst(struct st_isam_info *file,byte *buf,int inx);
|
|
||||||
extern int nisam_rkey(struct st_isam_info *file,byte *buf,int inx,
|
|
||||||
const byte *key,
|
|
||||||
uint key_len, enum ha_rkey_function search_flag);
|
|
||||||
extern int nisam_rlast(struct st_isam_info *file,byte *buf,int inx);
|
|
||||||
extern int nisam_rnext(struct st_isam_info *file,byte *buf,int inx);
|
|
||||||
extern int nisam_rprev(struct st_isam_info *file,byte *buf,int inx);
|
|
||||||
extern int nisam_rrnd(struct st_isam_info *file,byte *buf,ulong pos);
|
|
||||||
extern int nisam_rsame(struct st_isam_info *file,byte *record,int inx);
|
|
||||||
extern int nisam_rsame_with_pos(struct st_isam_info *file,byte *record,
|
|
||||||
int inx,ulong pos);
|
|
||||||
extern int nisam_update(struct st_isam_info *file,const byte *old,
|
|
||||||
const byte *new_record);
|
|
||||||
extern int nisam_write(struct st_isam_info *file,const byte *buff);
|
|
||||||
extern int nisam_info(struct st_isam_info *file,N_ISAMINFO *x,int flag);
|
|
||||||
extern ulong nisam_position(struct st_isam_info *info);
|
|
||||||
extern int nisam_lock_database(struct st_isam_info *file,int lock_type);
|
|
||||||
extern int nisam_create(const char *name,uint keys,N_KEYDEF *keyinfo,
|
|
||||||
N_RECINFO *recinfo,ulong records,
|
|
||||||
ulong reloc,uint flags,uint options,
|
|
||||||
ulong data_file_length);
|
|
||||||
extern int nisam_extra(struct st_isam_info *file,
|
|
||||||
enum ha_extra_function function);
|
|
||||||
extern ulong nisam_records_in_range(struct st_isam_info *info,int inx,
|
|
||||||
const byte *start_key,uint start_key_len,
|
|
||||||
enum ha_rkey_function start_search_flag,
|
|
||||||
const byte *end_key,uint end_key_len,
|
|
||||||
enum ha_rkey_function end_search_flag);
|
|
||||||
extern int nisam_log(int activate_log);
|
|
||||||
extern int nisam_is_changed(struct st_isam_info *info);
|
|
||||||
extern uint _calc_blob_length(uint length , const byte *pos);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
@@ -14,6 +14,7 @@ Created 2/23/1996 Heikki Tuuri
|
|||||||
|
|
||||||
#include "ut0byte.h"
|
#include "ut0byte.h"
|
||||||
#include "rem0cmp.h"
|
#include "rem0cmp.h"
|
||||||
|
#include "trx0trx.h"
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
Allocates memory for a persistent cursor object and initializes the cursor. */
|
Allocates memory for a persistent cursor object and initializes the cursor. */
|
||||||
@@ -206,7 +207,14 @@ btr_pcur_restore_position(
|
|||||||
|
|
||||||
ut_a(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
|
ut_a(cursor->pos_state == BTR_PCUR_WAS_POSITIONED
|
||||||
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
|| cursor->pos_state == BTR_PCUR_IS_POSITIONED);
|
||||||
ut_a(cursor->old_stored == BTR_PCUR_OLD_STORED);
|
if (cursor->old_stored != BTR_PCUR_OLD_STORED) {
|
||||||
|
ut_print_buf(stderr, (const byte*)cursor, sizeof(btr_pcur_t));
|
||||||
|
if (cursor->trx_if_known) {
|
||||||
|
trx_print(stderr, cursor->trx_if_known);
|
||||||
|
}
|
||||||
|
|
||||||
|
ut_a(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|
if (cursor->rel_pos == BTR_PCUR_AFTER_LAST_IN_TREE
|
||||||
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE) {
|
|| cursor->rel_pos == BTR_PCUR_BEFORE_FIRST_IN_TREE) {
|
||||||
|
|||||||
@@ -3333,6 +3333,9 @@ try_find_index:
|
|||||||
"Cannot find an index in the referenced table where the\n"
|
"Cannot find an index in the referenced table where the\n"
|
||||||
"referenced columns appear as the first columns, or column types\n"
|
"referenced columns appear as the first columns, or column types\n"
|
||||||
"in the table and the referenced table do not match for constraint.\n"
|
"in the table and the referenced table do not match for constraint.\n"
|
||||||
|
"Note that the internal storage type of ENUM and SET changed in\n"
|
||||||
|
"tables created with >= InnoDB-4.1.12, and such columns in old tables\n"
|
||||||
|
"cannot be referenced by such columns in new tables.\n"
|
||||||
"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
|
"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
|
||||||
"for correct foreign key definition.\n",
|
"for correct foreign key definition.\n",
|
||||||
start_of_latest_foreign);
|
start_of_latest_foreign);
|
||||||
|
|||||||
@@ -478,6 +478,10 @@ struct btr_pcur_struct{
|
|||||||
BTR_PCUR_WAS_POSITIONED,
|
BTR_PCUR_WAS_POSITIONED,
|
||||||
BTR_PCUR_NOT_POSITIONED */
|
BTR_PCUR_NOT_POSITIONED */
|
||||||
ulint search_mode; /* PAGE_CUR_G, ... */
|
ulint search_mode; /* PAGE_CUR_G, ... */
|
||||||
|
trx_t* trx_if_known; /* the transaction, if we know it;
|
||||||
|
otherwise this field is not defined;
|
||||||
|
can ONLY BE USED in error prints in
|
||||||
|
fatal assertion failures! */
|
||||||
/*-----------------------------*/
|
/*-----------------------------*/
|
||||||
/* NOTE that the following fields may possess dynamically allocated
|
/* NOTE that the following fields may possess dynamically allocated
|
||||||
memory which should be freed if not needed anymore! */
|
memory which should be freed if not needed anymore! */
|
||||||
|
|||||||
@@ -493,6 +493,8 @@ btr_pcur_open(
|
|||||||
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
|
btr_cur_search_to_nth_level(index, 0, tuple, mode, latch_mode,
|
||||||
btr_cursor, 0, mtr);
|
btr_cursor, 0, mtr);
|
||||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
@@ -535,6 +537,8 @@ btr_pcur_open_with_no_init(
|
|||||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
|
|
||||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
@@ -568,6 +572,8 @@ btr_pcur_open_at_index_side(
|
|||||||
pcur->pos_state = BTR_PCUR_IS_POSITIONED;
|
pcur->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
|
|
||||||
pcur->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
pcur->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||||
|
|
||||||
|
pcur->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@@ -592,6 +598,8 @@ btr_pcur_open_at_rnd_pos(
|
|||||||
btr_pcur_get_btr_cur(cursor), mtr);
|
btr_pcur_get_btr_cur(cursor), mtr);
|
||||||
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
|
||||||
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
cursor->old_stored = BTR_PCUR_OLD_NOT_STORED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
@@ -617,4 +625,6 @@ btr_pcur_close(
|
|||||||
|
|
||||||
cursor->latch_mode = BTR_NO_LATCHES;
|
cursor->latch_mode = BTR_NO_LATCHES;
|
||||||
cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
|
cursor->pos_state = BTR_PCUR_NOT_POSITIONED;
|
||||||
|
|
||||||
|
cursor->trx_if_known = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ log. */
|
|||||||
#define OS_FILE_OVERWRITE 53
|
#define OS_FILE_OVERWRITE 53
|
||||||
#define OS_FILE_OPEN_RAW 54
|
#define OS_FILE_OPEN_RAW 54
|
||||||
#define OS_FILE_CREATE_PATH 55
|
#define OS_FILE_CREATE_PATH 55
|
||||||
|
#define OS_FILE_OPEN_RETRY 56 /* for os_file_create() on
|
||||||
|
the first ibdata file */
|
||||||
|
|
||||||
#define OS_FILE_READ_ONLY 333
|
#define OS_FILE_READ_ONLY 333
|
||||||
#define OS_FILE_READ_WRITE 444
|
#define OS_FILE_READ_WRITE 444
|
||||||
|
|||||||
@@ -413,8 +413,6 @@ os_file_lock(
|
|||||||
"InnoDB: using the same InnoDB data or log files.\n");
|
"InnoDB: using the same InnoDB data or log files.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd);
|
|
||||||
|
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -989,6 +987,7 @@ try_again:
|
|||||||
} else if (access_type == OS_FILE_READ_WRITE
|
} else if (access_type == OS_FILE_READ_WRITE
|
||||||
&& os_file_lock(file, name)) {
|
&& os_file_lock(file, name)) {
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
close(file);
|
||||||
file = -1;
|
file = -1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
@@ -1101,6 +1100,7 @@ os_file_create_simple_no_error_handling(
|
|||||||
} else if (access_type == OS_FILE_READ_WRITE
|
} else if (access_type == OS_FILE_READ_WRITE
|
||||||
&& os_file_lock(file, name)) {
|
&& os_file_lock(file, name)) {
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
close(file);
|
||||||
file = -1;
|
file = -1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
@@ -1152,7 +1152,8 @@ try_again:
|
|||||||
if (create_mode == OS_FILE_OPEN_RAW) {
|
if (create_mode == OS_FILE_OPEN_RAW) {
|
||||||
create_flag = OPEN_EXISTING;
|
create_flag = OPEN_EXISTING;
|
||||||
share_mode = FILE_SHARE_WRITE;
|
share_mode = FILE_SHARE_WRITE;
|
||||||
} else if (create_mode == OS_FILE_OPEN) {
|
} else if (create_mode == OS_FILE_OPEN
|
||||||
|
|| create_mode == OS_FILE_OPEN_RETRY) {
|
||||||
create_flag = OPEN_EXISTING;
|
create_flag = OPEN_EXISTING;
|
||||||
} else if (create_mode == OS_FILE_CREATE) {
|
} else if (create_mode == OS_FILE_CREATE) {
|
||||||
create_flag = CREATE_NEW;
|
create_flag = CREATE_NEW;
|
||||||
@@ -1243,7 +1244,8 @@ try_again:
|
|||||||
try_again:
|
try_again:
|
||||||
ut_a(name);
|
ut_a(name);
|
||||||
|
|
||||||
if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW) {
|
if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
|
||||||
|
|| create_mode == OS_FILE_OPEN_RETRY) {
|
||||||
mode_str = "OPEN";
|
mode_str = "OPEN";
|
||||||
create_flag = O_RDWR;
|
create_flag = O_RDWR;
|
||||||
} else if (create_mode == OS_FILE_CREATE) {
|
} else if (create_mode == OS_FILE_CREATE) {
|
||||||
@@ -1316,6 +1318,23 @@ try_again:
|
|||||||
} else if (create_mode != OS_FILE_OPEN_RAW
|
} else if (create_mode != OS_FILE_OPEN_RAW
|
||||||
&& os_file_lock(file, name)) {
|
&& os_file_lock(file, name)) {
|
||||||
*success = FALSE;
|
*success = FALSE;
|
||||||
|
if (create_mode == OS_FILE_OPEN_RETRY) {
|
||||||
|
int i;
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: Retrying to lock the first data file\n",
|
||||||
|
stderr);
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
os_thread_sleep(1000000);
|
||||||
|
if (!os_file_lock(file, name)) {
|
||||||
|
*success = TRUE;
|
||||||
|
return(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ut_print_timestamp(stderr);
|
||||||
|
fputs(" InnoDB: Unable to open the first data file\n",
|
||||||
|
stderr);
|
||||||
|
}
|
||||||
|
close(file);
|
||||||
file = -1;
|
file = -1;
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2364,7 +2364,9 @@ row_sel_field_store_in_mysql_format(
|
|||||||
|
|
||||||
ut_a(templ->mbmaxlen > templ->mbminlen
|
ut_a(templ->mbmaxlen > templ->mbminlen
|
||||||
|| templ->mysql_col_len == len);
|
|| templ->mysql_col_len == len);
|
||||||
ut_a(!templ->mbmaxlen
|
/* The following assertion would fail for old tables
|
||||||
|
containing UTF-8 ENUM columns due to Bug #9526. */
|
||||||
|
ut_ad(!templ->mbmaxlen
|
||||||
|| !(templ->mysql_col_len % templ->mbmaxlen));
|
|| !(templ->mysql_col_len % templ->mbmaxlen));
|
||||||
ut_a(len * templ->mbmaxlen >= templ->mysql_col_len);
|
ut_a(len * templ->mbmaxlen >= templ->mysql_col_len);
|
||||||
|
|
||||||
@@ -2642,6 +2644,8 @@ row_sel_get_clust_rec_for_mysql(
|
|||||||
|
|
||||||
clust_rec = btr_pcur_get_rec(prebuilt->clust_pcur);
|
clust_rec = btr_pcur_get_rec(prebuilt->clust_pcur);
|
||||||
|
|
||||||
|
prebuilt->clust_pcur->trx_if_known = trx;
|
||||||
|
|
||||||
/* Note: only if the search ends up on a non-infimum record is the
|
/* Note: only if the search ends up on a non-infimum record is the
|
||||||
low_match value the real match to the search tuple */
|
low_match value the real match to the search tuple */
|
||||||
|
|
||||||
@@ -3404,6 +3408,8 @@ shortcut_fails_too_big_rec:
|
|||||||
btr_pcur_open_with_no_init(index, search_tuple, mode,
|
btr_pcur_open_with_no_init(index, search_tuple, mode,
|
||||||
BTR_SEARCH_LEAF,
|
BTR_SEARCH_LEAF,
|
||||||
pcur, 0, &mtr);
|
pcur, 0, &mtr);
|
||||||
|
|
||||||
|
pcur->trx_if_known = trx;
|
||||||
} else {
|
} else {
|
||||||
if (mode == PAGE_CUR_G) {
|
if (mode == PAGE_CUR_G) {
|
||||||
btr_pcur_open_at_index_side(TRUE, index,
|
btr_pcur_open_at_index_side(TRUE, index,
|
||||||
|
|||||||
@@ -789,6 +789,11 @@ open_or_create_data_files(
|
|||||||
files[i] = os_file_create(
|
files[i] = os_file_create(
|
||||||
name, OS_FILE_OPEN_RAW, OS_FILE_NORMAL,
|
name, OS_FILE_OPEN_RAW, OS_FILE_NORMAL,
|
||||||
OS_DATA_FILE, &ret);
|
OS_DATA_FILE, &ret);
|
||||||
|
} else if (i == 0) {
|
||||||
|
files[i] = os_file_create(
|
||||||
|
name, OS_FILE_OPEN_RETRY,
|
||||||
|
OS_FILE_NORMAL,
|
||||||
|
OS_DATA_FILE, &ret);
|
||||||
} else {
|
} else {
|
||||||
files[i] = os_file_create(
|
files[i] = os_file_create(
|
||||||
name, OS_FILE_OPEN, OS_FILE_NORMAL,
|
name, OS_FILE_OPEN, OS_FILE_NORMAL,
|
||||||
|
|||||||
@@ -32,38 +32,41 @@ endif
|
|||||||
|
|
||||||
benchdir_root= $(prefix)
|
benchdir_root= $(prefix)
|
||||||
testdir = $(benchdir_root)/mysql-test
|
testdir = $(benchdir_root)/mysql-test
|
||||||
EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh
|
EXTRA_SCRIPTS = mysql-test-run.sh mysql-test-run.pl install_test_db.sh valgrind.supp
|
||||||
EXTRA_DIST = $(EXTRA_SCRIPTS)
|
EXTRA_DIST = $(EXTRA_SCRIPTS)
|
||||||
test_SCRIPTS = mysql-test-run install_test_db
|
test_SCRIPTS = mysql-test-run install_test_db
|
||||||
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
|
test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem
|
||||||
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
CLEANFILES = $(test_SCRIPTS) $(test_DATA)
|
||||||
|
|
||||||
INCLUDES = -I$(srcdir)/../include -I../include -I..
|
INCLUDES = -I$(srcdir)/../include -I../include -I..
|
||||||
EXTRA_PROGRAMS = mysql_test_run_new
|
EXTRA_PROGRAMS = mysql_test_run_new
|
||||||
noinst_HEADERS = my_manage.h
|
noinst_HEADERS = my_manage.h
|
||||||
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
|
mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c
|
||||||
|
|
||||||
|
|
||||||
dist-hook:
|
dist-hook:
|
||||||
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
|
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
|
||||||
$(distdir)/std_data
|
$(distdir)/std_data $(distdir)/lib
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
|
||||||
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
|
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
|
$(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include
|
||||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(srcdir)/r/*.require $(distdir)/r
|
$(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data
|
||||||
|
$(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(distdir)/lib
|
||||||
|
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
|
||||||
|
|
||||||
install-data-local:
|
install-data-local:
|
||||||
$(mkinstalldirs) \
|
$(mkinstalldirs) \
|
||||||
$(DESTDIR)$(testdir)/t \
|
$(DESTDIR)$(testdir)/t \
|
||||||
$(DESTDIR)$(testdir)/r \
|
$(DESTDIR)$(testdir)/r \
|
||||||
$(DESTDIR)$(testdir)/include \
|
$(DESTDIR)$(testdir)/include \
|
||||||
$(DESTDIR)$(testdir)/std_data
|
$(DESTDIR)$(testdir)/std_data \
|
||||||
|
$(DESTDIR)$(testdir)/lib
|
||||||
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
|
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
|
||||||
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
|
-$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
|
||||||
@@ -71,7 +74,6 @@ install-data-local:
|
|||||||
$(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
|
$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
|
||||||
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
|
$(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
|
||||||
$(INSTALL_DATA) $(srcdir)/r/*.result.es $(DESTDIR)$(testdir)/r
|
|
||||||
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
|
$(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
|
||||||
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
|
$(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data
|
||||||
@@ -80,6 +82,8 @@ install-data-local:
|
|||||||
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
|
||||||
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
|
$(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
|
||||||
|
$(INSTALL_DATA) $(srcdir)/lib/init_db.sql $(DESTDIR)$(testdir)/lib
|
||||||
|
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
|
||||||
|
|
||||||
std_data/%.pem:
|
std_data/%.pem:
|
||||||
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
|
@CP@ $(top_srcdir)/SSL/$(@F) $(srcdir)/std_data
|
||||||
|
|||||||
4
mysql-test/include/big_test.inc
Normal file
4
mysql-test/include/big_test.inc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--require r/big_test.require
|
||||||
|
disable_query_log;
|
||||||
|
eval select $BIG_TEST as using_big_test;
|
||||||
|
enable_query_log;
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
-- require r/have_isam.require
|
|
||||||
disable_query_log;
|
|
||||||
show variables like "have_isam";
|
|
||||||
enable_query_log;
|
|
||||||
@@ -635,7 +635,6 @@ sub command_line_setup () {
|
|||||||
{
|
{
|
||||||
mtr_error("Can't use --extern with --embedded-server");
|
mtr_error("Can't use --extern with --embedded-server");
|
||||||
}
|
}
|
||||||
$opt_result_ext= ".es";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# FIXME don't understand what this is
|
# FIXME don't understand what this is
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ while test $# -gt 0; do
|
|||||||
fi
|
fi
|
||||||
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
|
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
|
||||||
valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck"
|
valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck"
|
||||||
VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16"
|
VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$CWD/valgrind.supp"
|
||||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||||
SLEEP_TIME_AFTER_RESTART=10
|
SLEEP_TIME_AFTER_RESTART=10
|
||||||
@@ -1179,7 +1179,7 @@ start_master()
|
|||||||
--default-character-set=$CHARACTER_SET \
|
--default-character-set=$CHARACTER_SET \
|
||||||
--tmpdir=$MYSQL_TMP_DIR \
|
--tmpdir=$MYSQL_TMP_DIR \
|
||||||
--language=$LANGUAGE \
|
--language=$LANGUAGE \
|
||||||
--innodb_data_file_path=ibdata1:50M \
|
--innodb_data_file_path=ibdata1:128M:autoextend \
|
||||||
--open-files-limit=1024 \
|
--open-files-limit=1024 \
|
||||||
$MASTER_40_ARGS \
|
$MASTER_40_ARGS \
|
||||||
$SMALL_SERVER \
|
$SMALL_SERVER \
|
||||||
@@ -1200,7 +1200,7 @@ start_master()
|
|||||||
$USE_NDBCLUSTER \
|
$USE_NDBCLUSTER \
|
||||||
--tmpdir=$MYSQL_TMP_DIR \
|
--tmpdir=$MYSQL_TMP_DIR \
|
||||||
--language=$LANGUAGE \
|
--language=$LANGUAGE \
|
||||||
--innodb_data_file_path=ibdata1:50M \
|
--innodb_data_file_path=ibdata1:128M:autoextend \
|
||||||
$MASTER_40_ARGS \
|
$MASTER_40_ARGS \
|
||||||
$SMALL_SERVER \
|
$SMALL_SERVER \
|
||||||
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
|
$EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ select 10.0+cast('a' as decimal);
|
|||||||
10.0+cast('a' as decimal)
|
10.0+cast('a' as decimal)
|
||||||
10.00
|
10.00
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Warning 1292 Truncated incorrect DECIMAL value: 'a'
|
||||||
select 10E+0+'a';
|
select 10E+0+'a';
|
||||||
10E+0+'a'
|
10E+0+'a'
|
||||||
10
|
10
|
||||||
|
|||||||
@@ -267,11 +267,15 @@ drop table t1;
|
|||||||
create table t1 (a int not null, b int, primary key (a));
|
create table t1 (a int not null, b int, primary key (a));
|
||||||
insert into t1 values (1,1);
|
insert into t1 values (1,1);
|
||||||
create table if not exists t1 select 2;
|
create table if not exists t1 select 2;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a b
|
a b
|
||||||
1 1
|
1 1
|
||||||
0 2
|
0 2
|
||||||
create table if not exists t1 select 3 as 'a',4 as 'b';
|
create table if not exists t1 select 3 as 'a',4 as 'b';
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
create table if not exists t1 select 3 as 'a',3 as 'b';
|
create table if not exists t1 select 3 as 'a',3 as 'b';
|
||||||
ERROR 23000: Duplicate entry '3' for key 1
|
ERROR 23000: Duplicate entry '3' for key 1
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
|||||||
@@ -220,12 +220,12 @@ select * from t1 where match a against ("te*" in boolean mode)+0;
|
|||||||
a
|
a
|
||||||
test
|
test
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (word varchar(255) not null, word2 varchar(255) not null, index(word));
|
create table t1 (word varchar(255) not null, word2 varchar(255) not null default '', index(word));
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`word` varchar(255) collate latin1_german2_ci NOT NULL,
|
`word` varchar(255) collate latin1_german2_ci NOT NULL,
|
||||||
`word2` varchar(255) collate latin1_german2_ci NOT NULL,
|
`word2` varchar(255) collate latin1_german2_ci NOT NULL default '',
|
||||||
KEY `word` (`word`)
|
KEY `word` (`word`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci
|
||||||
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
|
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
|
||||||
|
|||||||
@@ -2,27 +2,27 @@ DROP TABLE IF EXISTS t1;
|
|||||||
SET CHARACTER SET latin1;
|
SET CHARACTER SET latin1;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
comment CHAR(32) ASCII NOT NULL,
|
comment CHAR(32) ASCII NOT NULL,
|
||||||
koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL
|
koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL default ''
|
||||||
) CHARSET=latin5;
|
) CHARSET=latin5;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`comment` char(32) character set latin1 NOT NULL,
|
`comment` char(32) character set latin1 NOT NULL,
|
||||||
`koi8_ru_f` char(32) character set koi8r NOT NULL
|
`koi8_ru_f` char(32) character set koi8r NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
||||||
ALTER TABLE t1 CHANGE comment comment CHAR(32) CHARACTER SET latin2 NOT NULL;
|
ALTER TABLE t1 CHANGE comment comment CHAR(32) CHARACTER SET latin2 NOT NULL;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`comment` char(32) character set latin2 NOT NULL,
|
`comment` char(32) character set latin2 NOT NULL,
|
||||||
`koi8_ru_f` char(32) character set koi8r NOT NULL
|
`koi8_ru_f` char(32) character set koi8r NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
||||||
ALTER TABLE t1 ADD latin5_f CHAR(32) NOT NULL;
|
ALTER TABLE t1 ADD latin5_f CHAR(32) NOT NULL;
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`comment` char(32) character set latin2 NOT NULL,
|
`comment` char(32) character set latin2 NOT NULL,
|
||||||
`koi8_ru_f` char(32) character set koi8r NOT NULL,
|
`koi8_ru_f` char(32) character set koi8r NOT NULL default '',
|
||||||
`latin5_f` char(32) NOT NULL
|
`latin5_f` char(32) NOT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
||||||
ALTER TABLE t1 DEFAULT CHARSET=latin2;
|
ALTER TABLE t1 DEFAULT CHARSET=latin2;
|
||||||
@@ -31,7 +31,7 @@ SHOW CREATE TABLE t1;
|
|||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`comment` char(32) NOT NULL,
|
`comment` char(32) NOT NULL,
|
||||||
`koi8_ru_f` char(32) character set koi8r NOT NULL,
|
`koi8_ru_f` char(32) character set koi8r NOT NULL default '',
|
||||||
`latin5_f` char(32) character set latin5 NOT NULL,
|
`latin5_f` char(32) character set latin5 NOT NULL,
|
||||||
`latin2_f` char(32) NOT NULL
|
`latin2_f` char(32) NOT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
||||||
@@ -40,7 +40,7 @@ SHOW CREATE TABLE t1;
|
|||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`comment` char(32) NOT NULL,
|
`comment` char(32) NOT NULL,
|
||||||
`koi8_ru_f` char(32) character set koi8r NOT NULL
|
`koi8_ru_f` char(32) character set koi8r NOT NULL default ''
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
||||||
INSERT INTO t1 (koi8_ru_f,comment) VALUES ('a','LAT SMALL A');
|
INSERT INTO t1 (koi8_ru_f,comment) VALUES ('a','LAT SMALL A');
|
||||||
INSERT INTO t1 (koi8_ru_f,comment) VALUES ('b','LAT SMALL B');
|
INSERT INTO t1 (koi8_ru_f,comment) VALUES ('b','LAT SMALL B');
|
||||||
@@ -219,7 +219,7 @@ z LAT CAPIT Z 2
|
|||||||
э CYR CAPIT E 2
|
э CYR CAPIT E 2
|
||||||
ю CYR CAPIT YU 2
|
ю CYR CAPIT YU 2
|
||||||
я CYR CAPIT YA 2
|
я CYR CAPIT YA 2
|
||||||
ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL;
|
ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL default '';
|
||||||
UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8);
|
UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8);
|
||||||
SET CHARACTER SET koi8r;
|
SET CHARACTER SET koi8r;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
@@ -340,7 +340,7 @@ CYR CAPIT SOFT SIGN
|
|||||||
CYR CAPIT E <09> <09>
|
CYR CAPIT E <09> <09>
|
||||||
CYR CAPIT YU <09> <09>
|
CYR CAPIT YU <09> <09>
|
||||||
CYR CAPIT YA <09> <09>
|
CYR CAPIT YA <09> <09>
|
||||||
ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL;
|
ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default '';
|
||||||
UPDATE t1 SET bin_f=koi8_ru_f;
|
UPDATE t1 SET bin_f=koi8_ru_f;
|
||||||
SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
|
SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
|
||||||
COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f)
|
COUNT(DISTINCT bin_f) COUNT(DISTINCT koi8_ru_f) COUNT(DISTINCT utf8_f)
|
||||||
|
|||||||
@@ -30,13 +30,13 @@ table7, table8, table9, table10, table11, table12, table13,
|
|||||||
table14, table15, table16, table17, table18, table19, table20,
|
table14, table15, table16, table17, table18, table19, table20,
|
||||||
table21, table22, table23, table24, table25, table26, table27,
|
table21, table22, table23, table24, table25, table26, table27,
|
||||||
table28;
|
table28;
|
||||||
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
|
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table'
|
||||||
drop table table1, table2, table3, table4, table5, table6,
|
drop table table1, table2, table3, table4, table5, table6,
|
||||||
table7, table8, table9, table10, table11, table12, table13,
|
table7, table8, table9, table10, table11, table12, table13,
|
||||||
table14, table15, table16, table17, table18, table19, table20,
|
table14, table15, table16, table17, table18, table19, table20,
|
||||||
table21, table22, table23, table24, table25, table26, table27,
|
table21, table22, table23, table24, table25, table26, table27,
|
||||||
table28, table29, table30;
|
table28, table29, table30;
|
||||||
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
|
ERROR 42S02: Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table'
|
||||||
use test;
|
use test;
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
flush tables with read lock;
|
flush tables with read lock;
|
||||||
|
|||||||
@@ -758,7 +758,6 @@ SPATIAL KEY(g)
|
|||||||
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
|
INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)'));
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
geoobjid INT NOT NULL,
|
|
||||||
line LINESTRING NOT NULL,
|
line LINESTRING NOT NULL,
|
||||||
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
|
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
|
||||||
name VARCHAR(32),
|
name VARCHAR(32),
|
||||||
|
|||||||
@@ -157,6 +157,10 @@ select 1;
|
|||||||
1
|
1
|
||||||
1
|
1
|
||||||
insert into mysql.user (host, user) values ('localhost', 'test11');
|
insert into mysql.user (host, user) values ('localhost', 'test11');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
insert into mysql.db (host, db, user, select_priv) values
|
insert into mysql.db (host, db, user, select_priv) values
|
||||||
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
|
('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y');
|
||||||
alter table mysql.db order by db asc;
|
alter table mysql.db order by db asc;
|
||||||
|
|||||||
@@ -261,6 +261,10 @@ GRANT INSERT, UPDATE, DELETE ON `mysql`.* TO 'mysqltest_3'@'localhost'
|
|||||||
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
|
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
|
||||||
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user'
|
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 'user'
|
||||||
insert into mysql.user set host='%', user='mysqltest_B';
|
insert into mysql.user set host='%', user='mysqltest_B';
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
create user mysqltest_A@'%';
|
create user mysqltest_A@'%';
|
||||||
rename user mysqltest_B@'%' to mysqltest_C@'%';
|
rename user mysqltest_B@'%' to mysqltest_C@'%';
|
||||||
drop user mysqltest_C@'%';
|
drop user mysqltest_C@'%';
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
Variable_name Value
|
|
||||||
have_isam YES
|
|
||||||
@@ -436,30 +436,30 @@ f 10
|
|||||||
g 10
|
g 10
|
||||||
h 10
|
h 10
|
||||||
i 10
|
i 10
|
||||||
select sql_big_result v,count(t) from t1 group by v limit 10;
|
select sql_big_result trim(v),count(t) from t1 group by v limit 10;
|
||||||
v count(t)
|
trim(v) count(t)
|
||||||
a 1
|
a 1
|
||||||
a 10
|
a 10
|
||||||
b 10
|
b 10
|
||||||
c 10
|
c 10
|
||||||
d 10
|
d 10
|
||||||
e 10
|
e 10
|
||||||
f 10
|
f 10
|
||||||
g 10
|
g 10
|
||||||
h 10
|
h 10
|
||||||
i 10
|
i 10
|
||||||
select sql_big_result v,count(c) from t1 group by v limit 10;
|
select sql_big_result trim(v),count(c) from t1 group by v limit 10;
|
||||||
v count(c)
|
trim(v) count(c)
|
||||||
a 1
|
a 1
|
||||||
a 10
|
a 10
|
||||||
b 10
|
b 10
|
||||||
c 10
|
c 10
|
||||||
d 10
|
d 10
|
||||||
e 10
|
e 10
|
||||||
f 10
|
f 10
|
||||||
g 10
|
g 10
|
||||||
h 10
|
h 10
|
||||||
i 10
|
i 10
|
||||||
select c,count(*) from t1 group by c limit 10;
|
select c,count(*) from t1 group by c limit 10;
|
||||||
c count(*)
|
c count(*)
|
||||||
a 1
|
a 1
|
||||||
@@ -520,18 +520,18 @@ f 10
|
|||||||
g 10
|
g 10
|
||||||
h 10
|
h 10
|
||||||
i 10
|
i 10
|
||||||
select sql_big_result t,count(t) from t1 group by t limit 10;
|
select sql_big_result trim(t),count(t) from t1 group by t limit 10;
|
||||||
t count(t)
|
trim(t) count(t)
|
||||||
a 1
|
a 1
|
||||||
a 10
|
a 10
|
||||||
b 10
|
b 10
|
||||||
c 10
|
c 10
|
||||||
d 10
|
d 10
|
||||||
e 10
|
e 10
|
||||||
f 10
|
f 10
|
||||||
g 10
|
g 10
|
||||||
h 10
|
h 10
|
||||||
i 10
|
i 10
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a char(10), unique (a));
|
create table t1 (a char(10), unique (a));
|
||||||
insert into t1 values ('a');
|
insert into t1 values ('a');
|
||||||
@@ -667,14 +667,7 @@ drop table t1;
|
|||||||
set storage_engine=MyISAM;
|
set storage_engine=MyISAM;
|
||||||
create table t1 (a bigint unsigned auto_increment primary key, b int,
|
create table t1 (a bigint unsigned auto_increment primary key, b int,
|
||||||
key (b, a)) engine=heap;
|
key (b, a)) engine=heap;
|
||||||
insert t1 (b) values (1);
|
insert t1 (b) values (1),(1),(1),(1),(1),(1),(1),(1);
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a b
|
a b
|
||||||
1 1
|
1 1
|
||||||
@@ -688,14 +681,7 @@ a b
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a int not null, b int not null auto_increment,
|
create table t1 (a int not null, b int not null auto_increment,
|
||||||
primary key(a, b), key(b)) engine=heap;
|
primary key(a, b), key(b)) engine=heap;
|
||||||
insert t1 (a) values (1);
|
insert t1 (a) values (1),(1),(1),(1),(1),(1),(1),(1);
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
select * from t1;
|
select * from t1;
|
||||||
a b
|
a b
|
||||||
1 1
|
1 1
|
||||||
@@ -707,3 +693,6 @@ a b
|
|||||||
1 7
|
1 7
|
||||||
1 8
|
1 8
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a int not null, b int not null auto_increment,
|
||||||
|
primary key(a, b)) engine=heap;
|
||||||
|
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
|
||||||
|
|||||||
@@ -1,32 +1,48 @@
|
|||||||
insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1');
|
insert into mysql.help_category(help_category_id,name)values(1,'impossible_category_1');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @category1_id:= 1;
|
select @category1_id:= 1;
|
||||||
@category1_id:= 1
|
@category1_id:= 1
|
||||||
1
|
1
|
||||||
insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2');
|
insert into mysql.help_category(help_category_id,name)values(2,'impossible_category_2');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @category2_id:= 2;
|
select @category2_id:= 2;
|
||||||
@category2_id:= 2
|
@category2_id:= 2
|
||||||
2
|
2
|
||||||
insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id);
|
insert into mysql.help_category(help_category_id,name,parent_category_id)values(3,'impossible_category_3',@category2_id);
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @category3_id:= 3;
|
select @category3_id:= 3;
|
||||||
@category3_id:= 3
|
@category3_id:= 3
|
||||||
3
|
3
|
||||||
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1');
|
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(1,'impossible_function_1',@category1_id,'description of \n impossible_function1\n','example of \n impossible_function1');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @topic1_id:= 1;
|
select @topic1_id:= 1;
|
||||||
@topic1_id:= 1
|
@topic1_id:= 1
|
||||||
1
|
1
|
||||||
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2');
|
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(2,'impossible_function_2',@category1_id,'description of \n impossible_function2\n','example of \n impossible_function2');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @topic2_id:= 2;
|
select @topic2_id:= 2;
|
||||||
@topic2_id:= 2
|
@topic2_id:= 2
|
||||||
2
|
2
|
||||||
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3');
|
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(3,'impossible_function_3',@category2_id,'description of \n impossible_function3\n','example of \n impossible_function3');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @topic3_id:= 3;
|
select @topic3_id:= 3;
|
||||||
@topic3_id:= 3
|
@topic3_id:= 3
|
||||||
3
|
3
|
||||||
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4');
|
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(4,'impossible_function_4',@category2_id,'description of \n impossible_function4\n','example of \n impossible_function4');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @topic4_id:= 4;
|
select @topic4_id:= 4;
|
||||||
@topic4_id:= 4
|
@topic4_id:= 4
|
||||||
4
|
4
|
||||||
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7');
|
insert into mysql.help_topic(help_topic_id,name,help_category_id,description,example)values(5,'impossible_function_7',@category3_id,'description of \n impossible_function5\n','example of \n impossible_function7');
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'url' doesn't have a default value
|
||||||
select @topic5_id:= 5;
|
select @topic5_id:= 5;
|
||||||
@topic5_id:= 5
|
@topic5_id:= 5
|
||||||
5
|
5
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ mysql
|
|||||||
test
|
test
|
||||||
show databases where `database` = 't%';
|
show databases where `database` = 't%';
|
||||||
Database
|
Database
|
||||||
create database testtets;
|
create database mysqltest;
|
||||||
create table testtets.t1(a int, b VARCHAR(30), KEY string_data (b));
|
create table mysqltest.t1(a int, b VARCHAR(30), KEY string_data (b));
|
||||||
create table test.t2(a int);
|
create table test.t2(a int);
|
||||||
create table t3(a int, KEY a_data (a));
|
create table t3(a int, KEY a_data (a));
|
||||||
create table testtets.t4(a int);
|
create table mysqltest.t4(a int);
|
||||||
create view v1 (c) as select table_name from information_schema.TABLES;
|
create view v1 (c) as select table_name from information_schema.TABLES;
|
||||||
select * from v1;
|
select * from v1;
|
||||||
c
|
c
|
||||||
@@ -62,11 +62,11 @@ time_zone_name
|
|||||||
time_zone_transition
|
time_zone_transition
|
||||||
time_zone_transition_type
|
time_zone_transition_type
|
||||||
user
|
user
|
||||||
|
t1
|
||||||
|
t4
|
||||||
t2
|
t2
|
||||||
t3
|
t3
|
||||||
v1
|
v1
|
||||||
t1
|
|
||||||
t4
|
|
||||||
select c,table_name from v1
|
select c,table_name from v1
|
||||||
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
left join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
||||||
where v1.c like "t%";
|
where v1.c like "t%";
|
||||||
@@ -80,10 +80,10 @@ time_zone_leap_second time_zone_leap_second
|
|||||||
time_zone_name time_zone_name
|
time_zone_name time_zone_name
|
||||||
time_zone_transition time_zone_transition
|
time_zone_transition time_zone_transition
|
||||||
time_zone_transition_type time_zone_transition_type
|
time_zone_transition_type time_zone_transition_type
|
||||||
t2 t2
|
|
||||||
t3 t3
|
|
||||||
t1 t1
|
t1 t1
|
||||||
t4 t4
|
t4 t4
|
||||||
|
t2 t2
|
||||||
|
t3 t3
|
||||||
select c, v2.table_name from v1
|
select c, v2.table_name from v1
|
||||||
right join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
right join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
||||||
where v1.c like "t%";
|
where v1.c like "t%";
|
||||||
@@ -97,18 +97,18 @@ time_zone_leap_second time_zone_leap_second
|
|||||||
time_zone_name time_zone_name
|
time_zone_name time_zone_name
|
||||||
time_zone_transition time_zone_transition
|
time_zone_transition time_zone_transition
|
||||||
time_zone_transition_type time_zone_transition_type
|
time_zone_transition_type time_zone_transition_type
|
||||||
t2 t2
|
|
||||||
t3 t3
|
|
||||||
t1 t1
|
t1 t1
|
||||||
t4 t4
|
t4 t4
|
||||||
|
t2 t2
|
||||||
|
t3 t3
|
||||||
select table_name from information_schema.TABLES
|
select table_name from information_schema.TABLES
|
||||||
where table_schema = "testtets" and table_name like "t%";
|
where table_schema = "mysqltest" and table_name like "t%";
|
||||||
table_name
|
table_name
|
||||||
t1
|
t1
|
||||||
t4
|
t4
|
||||||
select * from information_schema.STATISTICS where TABLE_SCHEMA = "testtets";
|
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
|
||||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||||
NULL testtets t1 1 testtets string_data 1 b A NULL NULL NULL YES BTREE
|
NULL mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
|
||||||
show keys from t3 where Key_name = "a_data";
|
show keys from t3 where Key_name = "a_data";
|
||||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||||
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
|
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
|
||||||
@@ -133,13 +133,22 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
|
|||||||
select * from information_schema.COLUMNS where table_name="t1"
|
select * from information_schema.COLUMNS where table_name="t1"
|
||||||
and column_name= "a";
|
and column_name= "a";
|
||||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||||
NULL testtets t1 a 1 NULL YES int NULL NULL 11 0 NULL NULL int(11) select,insert,update,references
|
NULL mysqltest t1 a 1 NULL YES int NULL NULL 11 0 NULL NULL int(11) select,insert,update,references
|
||||||
show columns from testtets.t1 where field like "%a%";
|
show columns from mysqltest.t1 where field like "%a%";
|
||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
a int(11) YES NULL
|
a int(11) YES NULL
|
||||||
|
grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
|
||||||
|
select table_name, column_name, privileges from information_schema.columns
|
||||||
|
where table_schema = 'mysqltest' and table_name = 't1';
|
||||||
|
table_name column_name privileges
|
||||||
|
t1 a select
|
||||||
|
show columns from mysqltest.t1;
|
||||||
|
Field Type Null Key Default Extra
|
||||||
|
a int(11) YES NULL
|
||||||
|
b varchar(30) YES MUL NULL
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop tables testtets.t4, testtets.t1, t2, t3;
|
drop tables mysqltest.t4, mysqltest.t1, t2, t3;
|
||||||
drop database testtets;
|
drop database mysqltest;
|
||||||
select * from information_schema.CHARACTER_SETS
|
select * from information_schema.CHARACTER_SETS
|
||||||
where CHARACTER_SET_NAME like 'latin1%';
|
where CHARACTER_SET_NAME like 'latin1%';
|
||||||
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
|
CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
|
||||||
@@ -352,8 +361,8 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
|
|||||||
'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
|
'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
|
||||||
delete from mysql.user where user='mysqltest_1' or user='mysqltest_2';
|
delete from mysql.user where user='mysqltest_1' or user='mysqltest_2';
|
||||||
delete from mysql.db where user='mysqltest_1' or user='mysqltest_2';
|
delete from mysql.db where user='mysqltest_1' or user='mysqltest_2';
|
||||||
delete from mysql.tables_priv where user='mysqltest_1';
|
delete from mysql.tables_priv where user='mysqltest_1' or user='mysqltest_2';
|
||||||
delete from mysql.columns_priv where user='mysqltest_1';
|
delete from mysql.columns_priv where user='mysqltest_1' or user='mysqltest_2';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (a int null, primary key(a));
|
create table t1 (a int null, primary key(a));
|
||||||
|
|||||||
34
mysql-test/r/innodb-big.result
Normal file
34
mysql-test/r/innodb-big.result
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
DROP TABLE IF EXISTS t1, t2, t3, t4;
|
||||||
|
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM;
|
||||||
|
CREATE TABLE t2 (id INTEGER primary key) ENGINE=INNODB;
|
||||||
|
CREATE TABLE t3 (a char(32) primary key,id INTEGER) ENGINE=INNODB;
|
||||||
|
CREATE TABLE t4 (a char(32) primary key,id INTEGER) ENGINE=MYISAM;
|
||||||
|
INSERT INTO t1 (id) VALUES (1);
|
||||||
|
INSERT INTO t1 SELECT id+1 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+2 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+4 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+8 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+16 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+32 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+64 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+128 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+256 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+512 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+1024 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+2048 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+4096 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+8192 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+16384 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+32768 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+65536 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+131072 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+262144 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+524288 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+1048576 FROM t1;
|
||||||
|
INSERT INTO t2 SELECT * FROM t1;
|
||||||
|
INSERT INTO t3 SELECT concat(id),id from t2 ORDER BY -id;
|
||||||
|
INSERT INTO t4 SELECT * from t3 ORDER BY concat(a);
|
||||||
|
select sum(id) from t3;
|
||||||
|
sum(id)
|
||||||
|
2199024304128
|
||||||
|
drop table t1,t2,t3,t4;
|
||||||
@@ -924,3 +924,22 @@ a b a b
|
|||||||
3 1 NULL NULL
|
3 1 NULL NULL
|
||||||
4 2 NULL NULL
|
4 2 NULL NULL
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
set group_concat_max_len=5;
|
||||||
|
create table t1 (a int, b varchar(20));
|
||||||
|
create table t2 (a int, c varchar(20));
|
||||||
|
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
|
||||||
|
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
|
||||||
|
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a;
|
||||||
|
group_concat(t1.b,t2.c)
|
||||||
|
aaaaa
|
||||||
|
bbbbb
|
||||||
|
Warnings:
|
||||||
|
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
|
||||||
|
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
|
||||||
|
group_concat(t1.b,t2.c)
|
||||||
|
aaaaa
|
||||||
|
bbbbb
|
||||||
|
Warnings:
|
||||||
|
Warning 1260 2 line(s) were cut by GROUP_CONCAT()
|
||||||
|
drop table t1, t2;
|
||||||
|
set group_concat_max_len=default;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ select ((@id := kill_id) - kill_id) from t1;
|
|||||||
((@id := kill_id) - kill_id)
|
((@id := kill_id) - kill_id)
|
||||||
0
|
0
|
||||||
kill @id;
|
kill @id;
|
||||||
|
select 1;
|
||||||
|
Got one of the listed errors
|
||||||
select ((@id := kill_id) - kill_id) from t1;
|
select ((@id := kill_id) - kill_id) from t1;
|
||||||
((@id := kill_id) - kill_id)
|
((@id := kill_id) - kill_id)
|
||||||
0
|
0
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
create table t1 (a int primary key, b int not null);
|
create table t1 (a int not null default 0 primary key, b int not null default 0);
|
||||||
insert into t1 () values ();
|
insert into t1 () values ();
|
||||||
insert into t1 values (1,1),(2,1),(3,1);
|
insert into t1 values (1,1),(2,1),(3,1);
|
||||||
update t1 set a=4 where b=1 limit 1;
|
update t1 set a=4 where b=1 limit 1;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ insert into t1 values
|
|||||||
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
|
(0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
|
||||||
show table status;
|
show table status;
|
||||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
t1 ndbcluster 10 Dynamic 9 96 # # 0 # 101 # # # latin1_swedish_ci NULL #
|
t1 ndbcluster 10 Dynamic 9 96 # # 0 # 102 # # # latin1_swedish_ci NULL #
|
||||||
select * from t1 order by col1;
|
select * from t1 order by col1;
|
||||||
col1 col2 col3 col4 col5 col6 to_be_deleted
|
col1 col2 col3 col4 col5 col6 to_be_deleted
|
||||||
0 4 3 5 PENDING 1 7
|
0 4 3 5 PENDING 1 7
|
||||||
@@ -179,7 +179,7 @@ a b c
|
|||||||
2 two two
|
2 two two
|
||||||
alter table t1 drop index c;
|
alter table t1 drop index c;
|
||||||
select * from t1 where b = 'two';
|
select * from t1 where b = 'two';
|
||||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
ERROR HY000: Table definition has changed, please retry transaction
|
||||||
select * from t1 where b = 'two';
|
select * from t1 where b = 'two';
|
||||||
a b c
|
a b c
|
||||||
2 two two
|
2 two two
|
||||||
|
|||||||
@@ -607,3 +607,63 @@ primary key (a))
|
|||||||
engine=ndb
|
engine=ndb
|
||||||
max_rows=1;
|
max_rows=1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1
|
||||||
|
(counter int(64) NOT NULL auto_increment,
|
||||||
|
datavalue char(40) default 'XXXX',
|
||||||
|
primary key (counter)
|
||||||
|
) ENGINE=ndbcluster;
|
||||||
|
insert into t1 (datavalue) values ('newval');
|
||||||
|
insert into t1 (datavalue) values ('newval');
|
||||||
|
select * from t1 order by counter;
|
||||||
|
counter datavalue
|
||||||
|
1 newval
|
||||||
|
2 newval
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
select * from t1 order by counter;
|
||||||
|
counter datavalue
|
||||||
|
1 newval
|
||||||
|
2 newval
|
||||||
|
3 newval
|
||||||
|
4 newval
|
||||||
|
5 newval
|
||||||
|
6 newval
|
||||||
|
7 newval
|
||||||
|
8 newval
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
select * from t1 order by counter;
|
||||||
|
counter datavalue
|
||||||
|
1 newval
|
||||||
|
2 newval
|
||||||
|
3 newval
|
||||||
|
4 newval
|
||||||
|
5 newval
|
||||||
|
6 newval
|
||||||
|
7 newval
|
||||||
|
8 newval
|
||||||
|
35 newval
|
||||||
|
36 newval
|
||||||
|
37 newval
|
||||||
|
38 newval
|
||||||
|
39 newval
|
||||||
|
40 newval
|
||||||
|
41 newval
|
||||||
|
42 newval
|
||||||
|
43 newval
|
||||||
|
44 newval
|
||||||
|
45 newval
|
||||||
|
46 newval
|
||||||
|
47 newval
|
||||||
|
48 newval
|
||||||
|
49 newval
|
||||||
|
50 newval
|
||||||
|
51 newval
|
||||||
|
52 newval
|
||||||
|
53 newval
|
||||||
|
54 newval
|
||||||
|
55 newval
|
||||||
|
56 newval
|
||||||
|
57 newval
|
||||||
|
58 newval
|
||||||
|
drop table t1;
|
||||||
|
|||||||
@@ -1023,6 +1023,62 @@ auto
|
|||||||
1
|
1
|
||||||
3
|
3
|
||||||
4
|
4
|
||||||
|
update t1
|
||||||
|
set medium = 17
|
||||||
|
where
|
||||||
|
string = "aaaa" and
|
||||||
|
vstring = "aaaa" and
|
||||||
|
bin = 0xAAAA and
|
||||||
|
vbin = 0xAAAA and
|
||||||
|
tiny = -1 and
|
||||||
|
short = -1 and
|
||||||
|
medium = -1 and
|
||||||
|
long_int = -1 and
|
||||||
|
longlong = -1 and
|
||||||
|
real_float > 1.0 and real_float < 2.0 and
|
||||||
|
real_double > 1.0 and real_double < 2.0 and
|
||||||
|
real_decimal > 1.0 and real_decimal < 2.0 and
|
||||||
|
utiny = 1 and
|
||||||
|
ushort = 1 and
|
||||||
|
umedium = 1 and
|
||||||
|
ulong = 1 and
|
||||||
|
ulonglong = 1 and
|
||||||
|
/* bits = b'001' and */
|
||||||
|
options = 'one' and
|
||||||
|
flags = 'one' and
|
||||||
|
date_field = '1901-01-01' and
|
||||||
|
year_field = '1901' and
|
||||||
|
time_field = '01:01:01' and
|
||||||
|
date_time = '1901-01-01 01:01:01';
|
||||||
|
delete from t1
|
||||||
|
where
|
||||||
|
string = "aaaa" and
|
||||||
|
vstring = "aaaa" and
|
||||||
|
bin = 0xAAAA and
|
||||||
|
vbin = 0xAAAA and
|
||||||
|
tiny = -1 and
|
||||||
|
short = -1 and
|
||||||
|
medium = 17 and
|
||||||
|
long_int = -1 and
|
||||||
|
longlong = -1 and
|
||||||
|
real_float > 1.0 and real_float < 2.0 and
|
||||||
|
real_double > 1.0 and real_double < 2.0 and
|
||||||
|
real_decimal > 1.0 and real_decimal < 2.0 and
|
||||||
|
utiny = 1 and
|
||||||
|
ushort = 1 and
|
||||||
|
umedium = 1 and
|
||||||
|
ulong = 1 and
|
||||||
|
ulonglong = 1 and
|
||||||
|
/* bits = b'001' and */
|
||||||
|
options = 'one' and
|
||||||
|
flags = 'one' and
|
||||||
|
date_field = '1901-01-01' and
|
||||||
|
year_field = '1901' and
|
||||||
|
time_field = '01:01:01' and
|
||||||
|
date_time = '1901-01-01 01:01:01';
|
||||||
|
select count(*) from t1;
|
||||||
|
count(*)
|
||||||
|
3
|
||||||
explain
|
explain
|
||||||
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
|
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
|
||||||
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
|
||||||
@@ -1078,7 +1134,7 @@ pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4
|
|||||||
explain
|
explain
|
||||||
select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
|
select auto from t1 where string = "aaaa" collate latin1_general_ci order by auto;
|
||||||
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 t1 ALL NULL NULL NULL NULL 4 Using where; Using filesort
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using filesort
|
||||||
explain
|
explain
|
||||||
select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
|
select * from t2 where (attr1 < 2) = (attr2 < 2) order by pk1;
|
||||||
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
|
||||||
|
|||||||
@@ -47,3 +47,4 @@ t2
|
|||||||
t3
|
t3
|
||||||
t4
|
t4
|
||||||
drop table t1, t2, t3, t4;
|
drop table t1, t2, t3, t4;
|
||||||
|
drop table t1, t3, t4;
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ b ifnull(t2.b,"this is null")
|
|||||||
NULL this is null
|
NULL this is null
|
||||||
NULL this is null
|
NULL this is null
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
|
CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);
|
||||||
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1265 Data truncated for column 'd' at row 1
|
Warning 1265 Data truncated for column 'd' at row 1
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ favo_tijdschrift varchar(50) NOT NULL default '',
|
|||||||
favo_tv varchar(50) NOT NULL default '',
|
favo_tv varchar(50) NOT NULL default '',
|
||||||
favo_eten varchar(50) NOT NULL default '',
|
favo_eten varchar(50) NOT NULL default '',
|
||||||
favo_muziek varchar(30) NOT NULL default '',
|
favo_muziek varchar(30) NOT NULL default '',
|
||||||
info text NOT NULL,
|
info text NOT NULL default '',
|
||||||
ipnr varchar(30) NOT NULL default '',
|
ipnr varchar(30) NOT NULL default '',
|
||||||
PRIMARY KEY (member_id)
|
PRIMARY KEY (member_id)
|
||||||
) ENGINE=MyISAM PACK_KEYS=1;
|
) ENGINE=MyISAM PACK_KEYS=1;
|
||||||
|
|||||||
@@ -524,3 +524,21 @@ execute stmt using @a, @b, @c;
|
|||||||
a b c a b c
|
a b c a b c
|
||||||
deallocate prepare stmt;
|
deallocate prepare stmt;
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
SET @aux= "SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS A,
|
||||||
|
INFORMATION_SCHEMA.COLUMNS B
|
||||||
|
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
|
||||||
|
AND A.TABLE_NAME = B.TABLE_NAME
|
||||||
|
AND A.COLUMN_NAME = B.COLUMN_NAME AND
|
||||||
|
A.TABLE_NAME = 'user'";
|
||||||
|
prepare my_stmt from @aux;
|
||||||
|
execute my_stmt;
|
||||||
|
COUNT(*)
|
||||||
|
37
|
||||||
|
execute my_stmt;
|
||||||
|
COUNT(*)
|
||||||
|
37
|
||||||
|
execute my_stmt;
|
||||||
|
COUNT(*)
|
||||||
|
37
|
||||||
|
deallocate prepare my_stmt;
|
||||||
|
|||||||
@@ -3,12 +3,10 @@ CREATE TABLE t1 (
|
|||||||
gesuchnr int(11) DEFAULT '0' NOT NULL,
|
gesuchnr int(11) DEFAULT '0' NOT NULL,
|
||||||
benutzer_id int(11) DEFAULT '0' NOT NULL,
|
benutzer_id int(11) DEFAULT '0' NOT NULL,
|
||||||
PRIMARY KEY (gesuchnr,benutzer_id)
|
PRIMARY KEY (gesuchnr,benutzer_id)
|
||||||
) engine=ISAM;
|
);
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (2,1);
|
replace into t1 (gesuchnr,benutzer_id) values (2,1);
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
alter table t1 engine=myisam;
|
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
|
||||||
alter table t1 engine=heap;
|
alter table t1 engine=heap;
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'));
|
|||||||
row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'))
|
row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a'))
|
||||||
1
|
1
|
||||||
Warnings:
|
Warnings:
|
||||||
Error 1366 Incorrect decimal value: '' for column '' at row -1
|
Warning 1292 Truncated incorrect DECIMAL value: 'a'
|
||||||
Warning 1292 Truncated incorrect INTEGER value: 'a'
|
Warning 1292 Truncated incorrect INTEGER value: 'a'
|
||||||
select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3));
|
select row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3));
|
||||||
row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3))
|
row('a',0,3) IN (row(3,2,3), row('a','a','3'), row(1,3,3))
|
||||||
|
|||||||
@@ -61,6 +61,10 @@ create table t1 (n int);
|
|||||||
insert into t1 values(3456);
|
insert into t1 values(3456);
|
||||||
insert into mysql.user (Host, User, Password)
|
insert into mysql.user (Host, User, Password)
|
||||||
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'ssl_cipher' doesn't have a default value
|
||||||
|
Warning 1364 Field 'x509_issuer' doesn't have a default value
|
||||||
|
Warning 1364 Field 'x509_subject' doesn't have a default value
|
||||||
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
select_priv user
|
select_priv user
|
||||||
N blafasel2
|
N blafasel2
|
||||||
|
|||||||
@@ -89,4 +89,5 @@ a b
|
|||||||
2 row 2
|
2 row 2
|
||||||
3 row 3
|
3 row 3
|
||||||
0
|
0
|
||||||
|
drop database rewrite;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ h float(3,2) NULL YES NULL select,insert,update,references
|
|||||||
i float(3,0) NULL YES NULL select,insert,update,references
|
i float(3,0) NULL YES NULL select,insert,update,references
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (
|
create table t1 (
|
||||||
type_bool bool not null,
|
type_bool bool not null default 0,
|
||||||
type_tiny tinyint not null auto_increment primary key,
|
type_tiny tinyint not null auto_increment primary key,
|
||||||
type_short smallint(3),
|
type_short smallint(3),
|
||||||
type_mediumint mediumint,
|
type_mediumint mediumint,
|
||||||
@@ -206,9 +206,9 @@ empty_char char(0),
|
|||||||
type_char char(2),
|
type_char char(2),
|
||||||
type_varchar varchar(10),
|
type_varchar varchar(10),
|
||||||
type_timestamp timestamp not null,
|
type_timestamp timestamp not null,
|
||||||
type_date date not null,
|
type_date date not null default '0000-00-00',
|
||||||
type_time time not null,
|
type_time time not null default '00:00:00',
|
||||||
type_datetime datetime not null,
|
type_datetime datetime not null default '0000-00-00 00:00:00',
|
||||||
type_year year,
|
type_year year,
|
||||||
type_enum enum ('red', 'green', 'blue'),
|
type_enum enum ('red', 'green', 'blue'),
|
||||||
type_set enum ('red', 'green', 'blue'),
|
type_set enum ('red', 'green', 'blue'),
|
||||||
@@ -221,7 +221,7 @@ index(type_short)
|
|||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`type_bool` tinyint(1) NOT NULL,
|
`type_bool` tinyint(1) NOT NULL default '0',
|
||||||
`type_tiny` tinyint(4) NOT NULL auto_increment,
|
`type_tiny` tinyint(4) NOT NULL auto_increment,
|
||||||
`type_short` smallint(3) default NULL,
|
`type_short` smallint(3) default NULL,
|
||||||
`type_mediumint` mediumint(9) default NULL,
|
`type_mediumint` mediumint(9) default NULL,
|
||||||
@@ -232,9 +232,9 @@ t1 CREATE TABLE `t1` (
|
|||||||
`type_char` char(2) default NULL,
|
`type_char` char(2) default NULL,
|
||||||
`type_varchar` varchar(10) default NULL,
|
`type_varchar` varchar(10) default NULL,
|
||||||
`type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
`type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||||
`type_date` date NOT NULL,
|
`type_date` date NOT NULL default '0000-00-00',
|
||||||
`type_time` time NOT NULL,
|
`type_time` time NOT NULL default '00:00:00',
|
||||||
`type_datetime` datetime NOT NULL,
|
`type_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||||
`type_year` year(4) default NULL,
|
`type_year` year(4) default NULL,
|
||||||
`type_enum` enum('red','green','blue') default NULL,
|
`type_enum` enum('red','green','blue') default NULL,
|
||||||
`type_set` enum('red','green','blue') default NULL,
|
`type_set` enum('red','green','blue') default NULL,
|
||||||
|
|||||||
@@ -503,4 +503,68 @@ ERROR 0A000: LOCK is not allowed in stored procedures
|
|||||||
create procedure bug6600()
|
create procedure bug6600()
|
||||||
unlock table t1|
|
unlock table t1|
|
||||||
ERROR 0A000: UNLOCK is not allowed in stored procedures
|
ERROR 0A000: UNLOCK is not allowed in stored procedures
|
||||||
|
drop procedure if exists bug9566|
|
||||||
|
create procedure bug9566()
|
||||||
|
begin
|
||||||
|
select * from t1;
|
||||||
|
end|
|
||||||
|
lock table t1 read|
|
||||||
|
call bug9566()|
|
||||||
|
ERROR HY000: Table 'proc' was not locked with LOCK TABLES
|
||||||
|
unlock tables|
|
||||||
|
drop procedure bug9566|
|
||||||
|
drop procedure if exists bug7299|
|
||||||
|
create procedure bug7299()
|
||||||
|
begin
|
||||||
|
declare v int;
|
||||||
|
declare c cursor for select val from t1;
|
||||||
|
declare exit handler for sqlexception select 'Error!';
|
||||||
|
open c;
|
||||||
|
fetch c into v;
|
||||||
|
end|
|
||||||
|
delete from t1|
|
||||||
|
call bug7299()|
|
||||||
|
ERROR 02000: No data to FETCH
|
||||||
|
drop procedure bug7299|
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlexception select 1;
|
||||||
|
declare continue handler for sqlexception select 2;
|
||||||
|
end|
|
||||||
|
ERROR 42000: Duplicate handler declared in the same block
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for 1234;
|
||||||
|
declare continue handler for condname1 select 1;
|
||||||
|
declare exit handler for condname1 select 2;
|
||||||
|
end|
|
||||||
|
ERROR 42000: Duplicate handler declared in the same block
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for sqlstate '42000';
|
||||||
|
declare condname2 condition for sqlstate '42000';
|
||||||
|
declare exit handler for condname1 select 1;
|
||||||
|
declare continue handler for condname2 select 2;
|
||||||
|
end|
|
||||||
|
ERROR 42000: Duplicate handler declared in the same block
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for sqlstate '42000';
|
||||||
|
declare exit handler for condname1 select 1;
|
||||||
|
declare exit handler for sqlstate '42000' select 2;
|
||||||
|
end|
|
||||||
|
ERROR 42000: Duplicate handler declared in the same block
|
||||||
|
drop procedure if exists bug9073|
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for sqlstate '42000';
|
||||||
|
declare continue handler for condname1 select 1;
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlstate '42000' select 2;
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlstate '42000' select 3;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end|
|
||||||
|
drop procedure bug9073|
|
||||||
drop table t1|
|
drop table t1|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use test;
|
use test;
|
||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
create table t1 (
|
create table t1 (
|
||||||
id char(16) not null,
|
id char(16) not null default '',
|
||||||
data int not null
|
data int not null
|
||||||
);
|
);
|
||||||
drop table if exists t2;
|
drop table if exists t2;
|
||||||
@@ -2164,7 +2164,7 @@ tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
|
|||||||
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`id` char(16) NOT NULL,
|
`id` char(16) NOT NULL default '',
|
||||||
`data` int(11) NOT NULL
|
`data` int(11) NOT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
Database Create Database
|
Database Create Database
|
||||||
@@ -2218,7 +2218,7 @@ tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
|
|||||||
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
||||||
Table Create Table
|
Table Create Table
|
||||||
t1 CREATE TABLE `t1` (
|
t1 CREATE TABLE `t1` (
|
||||||
`id` char(16) NOT NULL,
|
`id` char(16) NOT NULL default '',
|
||||||
`data` int(11) NOT NULL
|
`data` int(11) NOT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
Database Create Database
|
Database Create Database
|
||||||
@@ -2779,4 +2779,69 @@ a
|
|||||||
3.2000
|
3.2000
|
||||||
drop procedure bug8937|
|
drop procedure bug8937|
|
||||||
delete from t1|
|
delete from t1|
|
||||||
|
drop procedure if exists bug6900|
|
||||||
|
drop procedure if exists bug9074|
|
||||||
|
drop procedure if exists bug6900_9074|
|
||||||
|
drop table if exists t3|
|
||||||
|
create table t3 (w char unique, x char)|
|
||||||
|
insert into t3 values ('a', 'b')|
|
||||||
|
create procedure bug6900()
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlexception select '1';
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlexception select '2';
|
||||||
|
insert into t3 values ('x', 'y', 'z');
|
||||||
|
end;
|
||||||
|
end|
|
||||||
|
create procedure bug9074()
|
||||||
|
begin
|
||||||
|
declare x1, x2, x3, x4, x5, x6 int default 0;
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlstate '23000' set x5 = 1;
|
||||||
|
insert into t3 values ('a', 'b');
|
||||||
|
set x6 = 1;
|
||||||
|
end;
|
||||||
|
begin1_label:
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlstate '23000' set x1 = 1;
|
||||||
|
insert into t3 values ('a', 'b');
|
||||||
|
set x2 = 1;
|
||||||
|
begin2_label:
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlstate '23000' set x3 = 1;
|
||||||
|
set x4= 1;
|
||||||
|
insert into t3 values ('a','b');
|
||||||
|
set x4= 0;
|
||||||
|
end begin2_label;
|
||||||
|
end begin1_label;
|
||||||
|
select x1, x2, x3, x4, x5, x6;
|
||||||
|
end|
|
||||||
|
create procedure bug6900_9074(z int)
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlstate '23000' select '23000';
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlexception select 'sqlexception';
|
||||||
|
if z = 1 then
|
||||||
|
insert into t3 values ('a', 'b');
|
||||||
|
else
|
||||||
|
insert into t3 values ('x', 'y', 'z');
|
||||||
|
end if;
|
||||||
|
end;
|
||||||
|
end|
|
||||||
|
call bug6900()|
|
||||||
|
2
|
||||||
|
2
|
||||||
|
call bug9074()|
|
||||||
|
x1 x2 x3 x4 x5 x6
|
||||||
|
1 1 1 1 1 1
|
||||||
|
call bug6900_9074(0)|
|
||||||
|
sqlexception
|
||||||
|
sqlexception
|
||||||
|
call bug6900_9074(1)|
|
||||||
|
23000
|
||||||
|
23000
|
||||||
|
drop procedure bug6900|
|
||||||
|
drop procedure bug9074|
|
||||||
|
drop procedure bug6900_9074|
|
||||||
|
drop table t3|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|||||||
@@ -1029,7 +1029,11 @@ Warnings:
|
|||||||
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'col1' at row 1
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'col1' at row 1
|
||||||
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'col2' at row 1
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'col2' at row 1
|
||||||
INSERT IGNORE INTO t1 (col1) values (3);
|
INSERT IGNORE INTO t1 (col1) values (3);
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'col2' doesn't have a default value
|
||||||
INSERT IGNORE INTO t1 () values ();
|
INSERT IGNORE INTO t1 () values ();
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'col2' doesn't have a default value
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
col1 col2
|
col1 col2
|
||||||
1 hello
|
1 hello
|
||||||
@@ -1180,9 +1184,51 @@ Note 1305 PROCEDURE t1 does not exist
|
|||||||
create procedure t1 () begin declare exit handler for sqlexception
|
create procedure t1 () begin declare exit handler for sqlexception
|
||||||
select'a'; insert into t1 values (200); end;|
|
select'a'; insert into t1 values (200); end;|
|
||||||
call t1();
|
call t1();
|
||||||
ERROR 22003: Out of range value adjusted for column 'col1' at row 1
|
a
|
||||||
|
a
|
||||||
select * from t1;
|
select * from t1;
|
||||||
col1
|
col1
|
||||||
drop procedure t1;
|
drop procedure t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
set sql_mode=@org_mode;
|
set sql_mode=@org_mode;
|
||||||
|
SET @@sql_mode = 'traditional';
|
||||||
|
CREATE TABLE t1 (i int not null);
|
||||||
|
INSERT INTO t1 VALUES ();
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 VALUES (DEFAULT);
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 VALUES (DEFAULT(i));
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
ALTER TABLE t1 ADD j int;
|
||||||
|
INSERT INTO t1 SET j = 1;
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 SET j = 1, i = DEFAULT;
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 VALUES (DEFAULT,1);
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
DROP TABLE t1;
|
||||||
|
SET @@sql_mode = '';
|
||||||
|
CREATE TABLE t1 (i int not null);
|
||||||
|
INSERT INTO t1 VALUES ();
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 VALUES (DEFAULT);
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 VALUES (DEFAULT(i));
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
ALTER TABLE t1 ADD j int;
|
||||||
|
INSERT INTO t1 SET j = 1;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 SET j = 1, i = DEFAULT;
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 SET j = 1, i = DEFAULT(i);
|
||||||
|
ERROR HY000: Field 'i' doesn't have a default value
|
||||||
|
INSERT INTO t1 VALUES (DEFAULT,1);
|
||||||
|
Warnings:
|
||||||
|
Warning 1364 Field 'i' doesn't have a default value
|
||||||
|
DROP TABLE t1;
|
||||||
|
|||||||
108
mysql-test/r/sum_distinct-big.result
Normal file
108
mysql-test/r/sum_distinct-big.result
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
using_big_test
|
||||||
|
0
|
||||||
|
CREATE TABLE t1 (id INTEGER);
|
||||||
|
CREATE TABLE t2 (id INTEGER);
|
||||||
|
INSERT INTO t1 (id) VALUES (1), (1), (1),(1);
|
||||||
|
INSERT INTO t1 (id) SELECT id FROM t1;
|
||||||
|
/* 8 */
|
||||||
|
INSERT INTO t1 (id) SELECT id FROM t1;
|
||||||
|
/* 12 */
|
||||||
|
INSERT INTO t1 (id) SELECT id FROM t1;
|
||||||
|
/* 16 */
|
||||||
|
INSERT INTO t1 (id) SELECT id FROM t1;
|
||||||
|
/* 20 */
|
||||||
|
INSERT INTO t1 (id) SELECT id FROM t1;
|
||||||
|
/* 24 */
|
||||||
|
INSERT INTO t1 SELECT id+1 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+2 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+4 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+8 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+16 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+32 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+64 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+128 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+256 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+512 FROM t1;
|
||||||
|
SELECT AVG(DISTINCT id) FROM t1 GROUP BY id % 13;
|
||||||
|
AVG(DISTINCT id)
|
||||||
|
513.5000
|
||||||
|
508.0000
|
||||||
|
509.0000
|
||||||
|
510.0000
|
||||||
|
511.0000
|
||||||
|
512.0000
|
||||||
|
513.0000
|
||||||
|
514.0000
|
||||||
|
515.0000
|
||||||
|
516.0000
|
||||||
|
517.0000
|
||||||
|
511.5000
|
||||||
|
512.5000
|
||||||
|
SELECT SUM(DISTINCT id)/COUNT(DISTINCT id) FROM t1 GROUP BY id % 13;
|
||||||
|
SUM(DISTINCT id)/COUNT(DISTINCT id)
|
||||||
|
513.50000
|
||||||
|
508.00000
|
||||||
|
509.00000
|
||||||
|
510.00000
|
||||||
|
511.00000
|
||||||
|
512.00000
|
||||||
|
513.00000
|
||||||
|
514.00000
|
||||||
|
515.00000
|
||||||
|
516.00000
|
||||||
|
517.00000
|
||||||
|
511.50000
|
||||||
|
512.50000
|
||||||
|
INSERT INTO t1 SELECT id+1024 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+2048 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+4096 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+8192 FROM t1;
|
||||||
|
INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand();
|
||||||
|
SELECT SUM(DISTINCT id) sm FROM t1;
|
||||||
|
sm
|
||||||
|
134225920
|
||||||
|
SELECT SUM(DISTINCT id) sm FROM t2;
|
||||||
|
sm
|
||||||
|
134225920
|
||||||
|
SELECT SUM(DISTINCT id) sm FROM t1 group by id % 13;
|
||||||
|
sm
|
||||||
|
10327590
|
||||||
|
10328851
|
||||||
|
10330112
|
||||||
|
10331373
|
||||||
|
10332634
|
||||||
|
10317510
|
||||||
|
10318770
|
||||||
|
10320030
|
||||||
|
10321290
|
||||||
|
10322550
|
||||||
|
10323810
|
||||||
|
10325070
|
||||||
|
10326330
|
||||||
|
SET max_heap_table_size=16384;
|
||||||
|
SHOW variables LIKE 'max_heap_table_size';
|
||||||
|
Variable_name Value
|
||||||
|
max_heap_table_size 16384
|
||||||
|
SELECT SUM(DISTINCT id) sm FROM t1;
|
||||||
|
sm
|
||||||
|
134225920
|
||||||
|
SELECT SUM(DISTINCT id) sm FROM t2;
|
||||||
|
sm
|
||||||
|
134225920
|
||||||
|
SELECT SUM(DISTINCT id) sm FROM t1 GROUP BY id % 13;
|
||||||
|
sm
|
||||||
|
10327590
|
||||||
|
10328851
|
||||||
|
10330112
|
||||||
|
10331373
|
||||||
|
10332634
|
||||||
|
10317510
|
||||||
|
10318770
|
||||||
|
10320030
|
||||||
|
10321290
|
||||||
|
10322550
|
||||||
|
10323810
|
||||||
|
10325070
|
||||||
|
10326330
|
||||||
|
DROP TABLE t1;
|
||||||
|
DROP TABLE t2;
|
||||||
@@ -95,109 +95,3 @@ SELECT SUM(DISTINCT id % 11) FROM t1;
|
|||||||
SUM(DISTINCT id % 11)
|
SUM(DISTINCT id % 11)
|
||||||
55
|
55
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
CREATE TABLE t1 (id INTEGER);
|
|
||||||
CREATE TABLE t2 (id INTEGER);
|
|
||||||
INSERT INTO t1 (id) VALUES (1), (1), (1),(1);
|
|
||||||
INSERT INTO t1 (id) SELECT id FROM t1;
|
|
||||||
/* 8 */
|
|
||||||
INSERT INTO t1 (id) SELECT id FROM t1;
|
|
||||||
/* 12 */
|
|
||||||
INSERT INTO t1 (id) SELECT id FROM t1;
|
|
||||||
/* 16 */
|
|
||||||
INSERT INTO t1 (id) SELECT id FROM t1;
|
|
||||||
/* 20 */
|
|
||||||
INSERT INTO t1 (id) SELECT id FROM t1;
|
|
||||||
/* 24 */
|
|
||||||
INSERT INTO t1 SELECT id+1 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+2 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+4 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+8 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+16 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+32 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+64 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+128 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+256 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+512 FROM t1;
|
|
||||||
SELECT AVG(DISTINCT id) FROM t1 GROUP BY id % 13;
|
|
||||||
AVG(DISTINCT id)
|
|
||||||
513.5000
|
|
||||||
508.0000
|
|
||||||
509.0000
|
|
||||||
510.0000
|
|
||||||
511.0000
|
|
||||||
512.0000
|
|
||||||
513.0000
|
|
||||||
514.0000
|
|
||||||
515.0000
|
|
||||||
516.0000
|
|
||||||
517.0000
|
|
||||||
511.5000
|
|
||||||
512.5000
|
|
||||||
SELECT SUM(DISTINCT id)/COUNT(DISTINCT id) FROM t1 GROUP BY id % 13;
|
|
||||||
SUM(DISTINCT id)/COUNT(DISTINCT id)
|
|
||||||
513.50000
|
|
||||||
508.00000
|
|
||||||
509.00000
|
|
||||||
510.00000
|
|
||||||
511.00000
|
|
||||||
512.00000
|
|
||||||
513.00000
|
|
||||||
514.00000
|
|
||||||
515.00000
|
|
||||||
516.00000
|
|
||||||
517.00000
|
|
||||||
511.50000
|
|
||||||
512.50000
|
|
||||||
INSERT INTO t1 SELECT id+1024 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+2048 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+4096 FROM t1;
|
|
||||||
INSERT INTO t1 SELECT id+8192 FROM t1;
|
|
||||||
INSERT INTO t2 SELECT id FROM t1 ORDER BY id*rand();
|
|
||||||
SELECT SUM(DISTINCT id) sm FROM t1;
|
|
||||||
sm
|
|
||||||
134225920
|
|
||||||
SELECT SUM(DISTINCT id) sm FROM t2;
|
|
||||||
sm
|
|
||||||
134225920
|
|
||||||
SELECT SUM(DISTINCT id) sm FROM t1 group by id % 13;
|
|
||||||
sm
|
|
||||||
10327590
|
|
||||||
10328851
|
|
||||||
10330112
|
|
||||||
10331373
|
|
||||||
10332634
|
|
||||||
10317510
|
|
||||||
10318770
|
|
||||||
10320030
|
|
||||||
10321290
|
|
||||||
10322550
|
|
||||||
10323810
|
|
||||||
10325070
|
|
||||||
10326330
|
|
||||||
SET max_heap_table_size=16384;
|
|
||||||
SHOW variables LIKE 'max_heap_table_size';
|
|
||||||
Variable_name Value
|
|
||||||
max_heap_table_size 16384
|
|
||||||
SELECT SUM(DISTINCT id) sm FROM t1;
|
|
||||||
sm
|
|
||||||
134225920
|
|
||||||
SELECT SUM(DISTINCT id) sm FROM t2;
|
|
||||||
sm
|
|
||||||
134225920
|
|
||||||
SELECT SUM(DISTINCT id) sm FROM t1 GROUP BY id % 13;
|
|
||||||
sm
|
|
||||||
10327590
|
|
||||||
10328851
|
|
||||||
10330112
|
|
||||||
10331373
|
|
||||||
10332634
|
|
||||||
10317510
|
|
||||||
10318770
|
|
||||||
10320030
|
|
||||||
10321290
|
|
||||||
10322550
|
|
||||||
10323810
|
|
||||||
10325070
|
|
||||||
10326330
|
|
||||||
DROP TABLE t1;
|
|
||||||
DROP TABLE t2;
|
|
||||||
|
|||||||
@@ -377,3 +377,6 @@ hex(concat(a)) hex(concat(b))
|
|||||||
07 0FFE
|
07 0FFE
|
||||||
01 01FF
|
01 01FF
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1(a int, b bit not null);
|
||||||
|
alter table t1 add primary key (a);
|
||||||
|
drop table t1;
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ select foobar, boggle from t1 where foobar = 'fish' and boggle = 10;
|
|||||||
foobar boggle
|
foobar boggle
|
||||||
fish 10
|
fish 10
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null);
|
create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default '');
|
||||||
insert into t1 (id) values (1);
|
insert into t1 (id) values (1);
|
||||||
select
|
select
|
||||||
charset(load_file('../../std_data/words.dat')),
|
charset(load_file('../../std_data/words.dat')),
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ time_field time,
|
|||||||
date_time datetime,
|
date_time datetime,
|
||||||
blob_col blob,
|
blob_col blob,
|
||||||
tinyblob_col tinyblob,
|
tinyblob_col tinyblob,
|
||||||
mediumblob_col mediumblob not null,
|
mediumblob_col mediumblob not null default '',
|
||||||
longblob_col longblob not null,
|
longblob_col longblob not null default '',
|
||||||
options enum('one','two','tree') not null,
|
options enum('one','two','tree') not null ,
|
||||||
flags set('one','two','tree') not null,
|
flags set('one','two','tree') not null default '',
|
||||||
PRIMARY KEY (auto),
|
PRIMARY KEY (auto),
|
||||||
KEY (utiny),
|
KEY (utiny),
|
||||||
KEY (tiny),
|
KEY (tiny),
|
||||||
|
|||||||
@@ -179,3 +179,6 @@ set @v1=null, @v2=1, @v3=1.1, @v4=now();
|
|||||||
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
select coercibility(@v1),coercibility(@v2),coercibility(@v3),coercibility(@v4);
|
||||||
coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
|
coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
|
||||||
2 2 2 2
|
2 2 2 2
|
||||||
|
set session @honk=99;
|
||||||
|
set one_shot @honk=99;
|
||||||
|
ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
|
||||||
|
|||||||
@@ -117,10 +117,12 @@ Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' a
|
|||||||
Warning 1265 Data truncated for column 'b' at row 4
|
Warning 1265 Data truncated for column 'b' at row 4
|
||||||
insert into t2(b) values('mysqlab');
|
insert into t2(b) values('mysqlab');
|
||||||
Warnings:
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
Warning 1265 Data truncated for column 'b' at row 1
|
Warning 1265 Data truncated for column 'b' at row 1
|
||||||
set sql_warnings=1;
|
set sql_warnings=1;
|
||||||
insert into t2(b) values('mysqlab');
|
insert into t2(b) values('mysqlab');
|
||||||
Warnings:
|
Warnings:
|
||||||
|
Warning 1364 Field 'a' doesn't have a default value
|
||||||
Warning 1265 Data truncated for column 'b' at row 1
|
Warning 1265 Data truncated for column 'b' at row 1
|
||||||
set sql_warnings=0;
|
set sql_warnings=0;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|||||||
45
mysql-test/r/xa.result
Normal file
45
mysql-test/r/xa.result
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
drop table if exists t1, t2;
|
||||||
|
create table t1 (a int) engine=innodb;
|
||||||
|
xa start 'test1';
|
||||||
|
insert t1 values (10);
|
||||||
|
xa end 'test1';
|
||||||
|
xa prepare 'test1';
|
||||||
|
xa rollback 'test1';
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
xa start 'test2';
|
||||||
|
xa start 'test-bad';
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed in the ACTIVE state
|
||||||
|
insert t1 values (20);
|
||||||
|
xa prepare 'test2';
|
||||||
|
ERROR XAE07: XAER_RMFAIL: The command cannot be executed in the ACTIVE state
|
||||||
|
xa end 'test2';
|
||||||
|
xa prepare 'test2';
|
||||||
|
xa commit 'test2';
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
20
|
||||||
|
xa start 'testa','testb';
|
||||||
|
insert t1 values (30);
|
||||||
|
xa end 'testa','testb';
|
||||||
|
xa start 0x7465737462, 0x2030405060, 0xb;
|
||||||
|
insert t1 values (40);
|
||||||
|
xa end 'testb',' 0@P`',11;
|
||||||
|
xa prepare 'testb',0x2030405060,11;
|
||||||
|
xa recover;
|
||||||
|
formatID gtrid_length bqual_length data
|
||||||
|
11 5 5 testb 0@P`
|
||||||
|
xa prepare 'testa','testb';
|
||||||
|
xa recover;
|
||||||
|
formatID gtrid_length bqual_length data
|
||||||
|
11 5 5 testb 0@P`
|
||||||
|
1 5 5 testatestb
|
||||||
|
xa commit 'testb',0x2030405060,11;
|
||||||
|
xa rollback 'testa','testb';
|
||||||
|
xa start 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
|
||||||
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
20
|
||||||
|
40
|
||||||
|
drop table t1;
|
||||||
@@ -66,7 +66,7 @@ drop table t1;
|
|||||||
#
|
#
|
||||||
# The below checks both binary and character comparisons.
|
# The below checks both binary and character comparisons.
|
||||||
#
|
#
|
||||||
create table t1 (word varchar(255) not null, word2 varchar(255) not null, index(word));
|
create table t1 (word varchar(255) not null, word2 varchar(255) not null default '', index(word));
|
||||||
show create table t1;
|
show create table t1;
|
||||||
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
|
insert into t1 (word) values ('ss'),(0xDF),(0xE4),('ae');
|
||||||
update t1 set word2=word;
|
update t1 set word2=word;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ SET CHARACTER SET latin1;
|
|||||||
|
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
comment CHAR(32) ASCII NOT NULL,
|
comment CHAR(32) ASCII NOT NULL,
|
||||||
koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL
|
koi8_ru_f CHAR(32) CHARACTER SET koi8r NOT NULL default ''
|
||||||
) CHARSET=latin5;
|
) CHARSET=latin5;
|
||||||
|
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
@@ -142,13 +142,13 @@ INSERT INTO t1 (koi8_ru_f,comment) VALUES (_koi8r'
|
|||||||
SET CHARACTER SET utf8;
|
SET CHARACTER SET utf8;
|
||||||
SELECT koi8_ru_f,MIN(comment),COUNT(*) FROM t1 GROUP BY 1;
|
SELECT koi8_ru_f,MIN(comment),COUNT(*) FROM t1 GROUP BY 1;
|
||||||
|
|
||||||
ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL;
|
ALTER TABLE t1 ADD utf8_f CHAR(32) CHARACTER SET utf8 NOT NULL default '';
|
||||||
UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8);
|
UPDATE t1 SET utf8_f=CONVERT(koi8_ru_f USING utf8);
|
||||||
SET CHARACTER SET koi8r;
|
SET CHARACTER SET koi8r;
|
||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL;
|
ALTER TABLE t1 ADD bin_f CHAR(32) BYTE NOT NULL default '';
|
||||||
UPDATE t1 SET bin_f=koi8_ru_f;
|
UPDATE t1 SET bin_f=koi8_ru_f;
|
||||||
SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
|
SELECT COUNT(DISTINCT bin_f),COUNT(DISTINCT koi8_ru_f),COUNT(DISTINCT utf8_f) FROM t1;
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('
|
|||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
CREATE TABLE t1 (
|
CREATE TABLE t1 (
|
||||||
geoobjid INT NOT NULL,
|
|
||||||
line LINESTRING NOT NULL,
|
line LINESTRING NOT NULL,
|
||||||
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
|
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
|
||||||
name VARCHAR(32),
|
name VARCHAR(32),
|
||||||
|
|||||||
@@ -280,14 +280,14 @@ explain select * from t1 where v='a';
|
|||||||
select v,count(*) from t1 group by v limit 10;
|
select v,count(*) from t1 group by v limit 10;
|
||||||
select v,count(t) from t1 group by v limit 10;
|
select v,count(t) from t1 group by v limit 10;
|
||||||
select v,count(c) from t1 group by v limit 10;
|
select v,count(c) from t1 group by v limit 10;
|
||||||
select sql_big_result v,count(t) from t1 group by v limit 10;
|
select sql_big_result trim(v),count(t) from t1 group by v limit 10;
|
||||||
select sql_big_result v,count(c) from t1 group by v limit 10;
|
select sql_big_result trim(v),count(c) from t1 group by v limit 10;
|
||||||
select c,count(*) from t1 group by c limit 10;
|
select c,count(*) from t1 group by c limit 10;
|
||||||
select c,count(t) from t1 group by c limit 10;
|
select c,count(t) from t1 group by c limit 10;
|
||||||
select sql_big_result c,count(t) from t1 group by c limit 10;
|
select sql_big_result c,count(t) from t1 group by c limit 10;
|
||||||
select t,count(*) from t1 group by t limit 10;
|
select t,count(*) from t1 group by t limit 10;
|
||||||
select t,count(t) from t1 group by t limit 10;
|
select t,count(t) from t1 group by t limit 10;
|
||||||
select sql_big_result t,count(t) from t1 group by t limit 10;
|
select sql_big_result trim(t),count(t) from t1 group by t limit 10;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -413,25 +413,16 @@ eval set storage_engine=$default;
|
|||||||
|
|
||||||
create table t1 (a bigint unsigned auto_increment primary key, b int,
|
create table t1 (a bigint unsigned auto_increment primary key, b int,
|
||||||
key (b, a)) engine=heap;
|
key (b, a)) engine=heap;
|
||||||
insert t1 (b) values (1);
|
insert t1 (b) values (1),(1),(1),(1),(1),(1),(1),(1);
|
||||||
insert t1 (b) values (1);
|
select * from t1;
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
insert t1 (b) values (1);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
create table t1 (a int not null, b int not null auto_increment,
|
create table t1 (a int not null, b int not null auto_increment,
|
||||||
primary key(a, b), key(b)) engine=heap;
|
primary key(a, b), key(b)) engine=heap;
|
||||||
insert t1 (a) values (1);
|
insert t1 (a) values (1),(1),(1),(1),(1),(1),(1),(1);
|
||||||
insert t1 (a) values (1);
|
select * from t1;
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
insert t1 (a) values (1);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
--error 1075
|
||||||
|
create table t1 (a int not null, b int not null auto_increment,
|
||||||
|
primary key(a, b)) engine=heap;
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ drop table if exists t0,t1,t2;
|
|||||||
create table t1
|
create table t1
|
||||||
(
|
(
|
||||||
/* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */
|
/* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */
|
||||||
st_a int not null,
|
st_a int not null default 0,
|
||||||
swt1a int not null,
|
swt1a int not null default 0,
|
||||||
swt2a int not null,
|
swt2a int not null default 0,
|
||||||
|
|
||||||
st_b int not null,
|
st_b int not null default 0,
|
||||||
swt1b int not null,
|
swt1b int not null default 0,
|
||||||
swt2b int not null,
|
swt2b int not null default 0,
|
||||||
|
|
||||||
/* fields/keys for row retrieval tests */
|
/* fields/keys for row retrieval tests */
|
||||||
key1 int,
|
key1 int,
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ show databases where `database` = 't%';
|
|||||||
# Test for information_schema.tables &
|
# Test for information_schema.tables &
|
||||||
# show tables
|
# show tables
|
||||||
|
|
||||||
create database testtets;
|
create database mysqltest;
|
||||||
create table testtets.t1(a int, b VARCHAR(30), KEY string_data (b));
|
create table mysqltest.t1(a int, b VARCHAR(30), KEY string_data (b));
|
||||||
create table test.t2(a int);
|
create table test.t2(a int);
|
||||||
create table t3(a int, KEY a_data (a));
|
create table t3(a int, KEY a_data (a));
|
||||||
create table testtets.t4(a int);
|
create table mysqltest.t4(a int);
|
||||||
create view v1 (c) as select table_name from information_schema.TABLES;
|
create view v1 (c) as select table_name from information_schema.TABLES;
|
||||||
select * from v1;
|
select * from v1;
|
||||||
select c,table_name from v1
|
select c,table_name from v1
|
||||||
@@ -33,9 +33,9 @@ right join information_schema.TABLES v2 on (v1.c=v2.table_name)
|
|||||||
where v1.c like "t%";
|
where v1.c like "t%";
|
||||||
|
|
||||||
select table_name from information_schema.TABLES
|
select table_name from information_schema.TABLES
|
||||||
where table_schema = "testtets" and table_name like "t%";
|
where table_schema = "mysqltest" and table_name like "t%";
|
||||||
|
|
||||||
select * from information_schema.STATISTICS where TABLE_SCHEMA = "testtets";
|
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
|
||||||
show keys from t3 where Key_name = "a_data";
|
show keys from t3 where Key_name = "a_data";
|
||||||
|
|
||||||
show tables like 't%';
|
show tables like 't%';
|
||||||
@@ -46,11 +46,19 @@ show full columns from mysql.db like "Insert%";
|
|||||||
show full columns from v1;
|
show full columns from v1;
|
||||||
select * from information_schema.COLUMNS where table_name="t1"
|
select * from information_schema.COLUMNS where table_name="t1"
|
||||||
and column_name= "a";
|
and column_name= "a";
|
||||||
show columns from testtets.t1 where field like "%a%";
|
show columns from mysqltest.t1 where field like "%a%";
|
||||||
|
|
||||||
|
grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
|
||||||
|
connect (user3,localhost,mysqltest_2,,);
|
||||||
|
connection user3;
|
||||||
|
select table_name, column_name, privileges from information_schema.columns
|
||||||
|
where table_schema = 'mysqltest' and table_name = 't1';
|
||||||
|
show columns from mysqltest.t1;
|
||||||
|
connection default;
|
||||||
|
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop tables testtets.t4, testtets.t1, t2, t3;
|
drop tables mysqltest.t4, mysqltest.t1, t2, t3;
|
||||||
drop database testtets;
|
drop database mysqltest;
|
||||||
|
|
||||||
# Test for information_schema.CHARACTER_SETS &
|
# Test for information_schema.CHARACTER_SETS &
|
||||||
# SHOW CHARACTER SET
|
# SHOW CHARACTER SET
|
||||||
@@ -107,7 +115,6 @@ mysql.proc b where a.ROUTINE_NAME = convert(b.name using utf8);
|
|||||||
select count(*) from information_schema.ROUTINES;
|
select count(*) from information_schema.ROUTINES;
|
||||||
|
|
||||||
connect (user1,localhost,mysqltest_1,,);
|
connect (user1,localhost,mysqltest_1,,);
|
||||||
connect (user3,localhost,mysqltest_2,,);
|
|
||||||
connection user1;
|
connection user1;
|
||||||
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
|
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
|
||||||
--error 1305
|
--error 1305
|
||||||
@@ -166,8 +173,8 @@ select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest
|
|||||||
select * from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%';
|
select * from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%';
|
||||||
delete from mysql.user where user='mysqltest_1' or user='mysqltest_2';
|
delete from mysql.user where user='mysqltest_1' or user='mysqltest_2';
|
||||||
delete from mysql.db where user='mysqltest_1' or user='mysqltest_2';
|
delete from mysql.db where user='mysqltest_1' or user='mysqltest_2';
|
||||||
delete from mysql.tables_priv where user='mysqltest_1';
|
delete from mysql.tables_priv where user='mysqltest_1' or user='mysqltest_2';
|
||||||
delete from mysql.columns_priv where user='mysqltest_1';
|
delete from mysql.columns_priv where user='mysqltest_1' or user='mysqltest_2';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
|||||||
46
mysql-test/t/innodb-big.test
Normal file
46
mysql-test/t/innodb-big.test
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
#
|
||||||
|
# Test some things that takes a long time
|
||||||
|
|
||||||
|
-- source include/big_test.inc
|
||||||
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
DROP TABLE IF EXISTS t1, t2, t3, t4;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test test how filesort and buffered-record-reads works with innodb
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM;
|
||||||
|
CREATE TABLE t2 (id INTEGER primary key) ENGINE=INNODB;
|
||||||
|
CREATE TABLE t3 (a char(32) primary key,id INTEGER) ENGINE=INNODB;
|
||||||
|
CREATE TABLE t4 (a char(32) primary key,id INTEGER) ENGINE=MYISAM;
|
||||||
|
|
||||||
|
INSERT INTO t1 (id) VALUES (1);
|
||||||
|
INSERT INTO t1 SELECT id+1 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+2 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+4 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+8 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+16 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+32 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+64 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+128 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+256 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+512 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+1024 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+2048 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+4096 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+8192 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+16384 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+32768 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+65536 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+131072 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+262144 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+524288 FROM t1;
|
||||||
|
INSERT INTO t1 SELECT id+1048576 FROM t1;
|
||||||
|
INSERT INTO t2 SELECT * FROM t1;
|
||||||
|
INSERT INTO t3 SELECT concat(id),id from t2 ORDER BY -id;
|
||||||
|
INSERT INTO t4 SELECT * from t3 ORDER BY concat(a);
|
||||||
|
select sum(id) from t3;
|
||||||
|
drop table t1,t2,t3,t4;
|
||||||
@@ -1,247 +0,0 @@
|
|||||||
-- source include/have_isam.inc
|
|
||||||
|
|
||||||
--disable_warnings
|
|
||||||
drop table if exists t1,t2;
|
|
||||||
--enable_warnings
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test possible problem with rows that are about 65535 bytes long
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (a tinyint not null auto_increment, b blob not null, primary key (a)) engine=isam;
|
|
||||||
|
|
||||||
let $1=100;
|
|
||||||
disable_query_log;
|
|
||||||
--disable_warnings
|
|
||||||
while ($1)
|
|
||||||
{
|
|
||||||
eval insert into t1 (b) values(repeat(char(65+$1),65540-$1));
|
|
||||||
dec $1;
|
|
||||||
}
|
|
||||||
enable_query_log;
|
|
||||||
--enable_warnings
|
|
||||||
delete from t1 where (a & 1);
|
|
||||||
select sum(length(b)) from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test of auto_increment; The test for BDB tables is in bdb.test
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (a int not null auto_increment,b int, primary key (a)) engine=isam;
|
|
||||||
insert into t1 values (1,1),(NULL,2),(3,3),(NULL,4);
|
|
||||||
delete from t1 where a=4 or a=2;
|
|
||||||
insert into t1 values (NULL,4),(NULL,5),(6,6);
|
|
||||||
select * from t1;
|
|
||||||
delete from t1 where a=6;
|
|
||||||
#show table status like "t1";
|
|
||||||
replace t1 values (3,1);
|
|
||||||
replace t1 values (3,3);
|
|
||||||
ALTER TABLE t1 add c int;
|
|
||||||
insert into t1 values (NULL,6,6);
|
|
||||||
select * from t1;
|
|
||||||
drop table t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test of some CREATE TABLE's that should fail
|
|
||||||
#
|
|
||||||
--error 1121
|
|
||||||
create table t1 (a int,b text, index(a)) engine=isam;
|
|
||||||
--error 1073
|
|
||||||
create table t1 (a int,b text, index(b)) engine=isam;
|
|
||||||
--error 1075
|
|
||||||
create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=isam;
|
|
||||||
--error 1121
|
|
||||||
create table t1 (ordid int(8), unique (ordid)) engine=isam;
|
|
||||||
drop table if exists t1;
|
|
||||||
|
|
||||||
#
|
|
||||||
# Test of some show commands
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
|
|
||||||
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
|
|
||||||
create table t2 engine=isam select * from t1;
|
|
||||||
optimize table t1;
|
|
||||||
check table t1,t2;
|
|
||||||
repair table t1,t2;
|
|
||||||
check table t2,t1;
|
|
||||||
lock tables t1 write;
|
|
||||||
check table t2,t1;
|
|
||||||
show columns from t1;
|
|
||||||
show full columns from t1;
|
|
||||||
show index from t1;
|
|
||||||
drop table t1,t2;
|
|
||||||
|
|
||||||
#
|
|
||||||
# test of table with huge number of packed fields
|
|
||||||
#
|
|
||||||
|
|
||||||
create table t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
|
|
||||||
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
|
|
||||||
int, i18 int, i19 int, i20 int, i21 int, i22 int, i23 int, i24 int, i25 int,
|
|
||||||
i26 int, i27 int, i28 int, i29 int, i30 int, i31 int, i32 int, i33 int, i34
|
|
||||||
int, i35 int, i36 int, i37 int, i38 int, i39 int, i40 int, i41 int, i42 int,
|
|
||||||
i43 int, i44 int, i45 int, i46 int, i47 int, i48 int, i49 int, i50 int, i51
|
|
||||||
int, i52 int, i53 int, i54 int, i55 int, i56 int, i57 int, i58 int, i59 int,
|
|
||||||
i60 int, i61 int, i62 int, i63 int, i64 int, i65 int, i66 int, i67 int, i68
|
|
||||||
int, i69 int, i70 int, i71 int, i72 int, i73 int, i74 int, i75 int, i76 int,
|
|
||||||
i77 int, i78 int, i79 int, i80 int, i81 int, i82 int, i83 int, i84 int, i85
|
|
||||||
int, i86 int, i87 int, i88 int, i89 int, i90 int, i91 int, i92 int, i93 int,
|
|
||||||
i94 int, i95 int, i96 int, i97 int, i98 int, i99 int, i100 int, i101 int, i102
|
|
||||||
int, i103 int, i104 int, i105 int, i106 int, i107 int, i108 int, i109 int, i110
|
|
||||||
int, i111 int, i112 int, i113 int, i114 int, i115 int, i116 int, i117 int, i118
|
|
||||||
int, i119 int, i120 int, i121 int, i122 int, i123 int, i124 int, i125 int, i126
|
|
||||||
int, i127 int, i128 int, i129 int, i130 int, i131 int, i132 int, i133 int, i134
|
|
||||||
int, i135 int, i136 int, i137 int, i138 int, i139 int, i140 int, i141 int, i142
|
|
||||||
int, i143 int, i144 int, i145 int, i146 int, i147 int, i148 int, i149 int, i150
|
|
||||||
int, i151 int, i152 int, i153 int, i154 int, i155 int, i156 int, i157 int, i158
|
|
||||||
int, i159 int, i160 int, i161 int, i162 int, i163 int, i164 int, i165 int, i166
|
|
||||||
int, i167 int, i168 int, i169 int, i170 int, i171 int, i172 int, i173 int, i174
|
|
||||||
int, i175 int, i176 int, i177 int, i178 int, i179 int, i180 int, i181 int, i182
|
|
||||||
int, i183 int, i184 int, i185 int, i186 int, i187 int, i188 int, i189 int, i190
|
|
||||||
int, i191 int, i192 int, i193 int, i194 int, i195 int, i196 int, i197 int, i198
|
|
||||||
int, i199 int, i200 int, i201 int, i202 int, i203 int, i204 int, i205 int, i206
|
|
||||||
int, i207 int, i208 int, i209 int, i210 int, i211 int, i212 int, i213 int, i214
|
|
||||||
int, i215 int, i216 int, i217 int, i218 int, i219 int, i220 int, i221 int, i222
|
|
||||||
int, i223 int, i224 int, i225 int, i226 int, i227 int, i228 int, i229 int, i230
|
|
||||||
int, i231 int, i232 int, i233 int, i234 int, i235 int, i236 int, i237 int, i238
|
|
||||||
int, i239 int, i240 int, i241 int, i242 int, i243 int, i244 int, i245 int, i246
|
|
||||||
int, i247 int, i248 int, i249 int, i250 int, i251 int, i252 int, i253 int, i254
|
|
||||||
int, i255 int, i256 int, i257 int, i258 int, i259 int, i260 int, i261 int, i262
|
|
||||||
int, i263 int, i264 int, i265 int, i266 int, i267 int, i268 int, i269 int, i270
|
|
||||||
int, i271 int, i272 int, i273 int, i274 int, i275 int, i276 int, i277 int, i278
|
|
||||||
int, i279 int, i280 int, i281 int, i282 int, i283 int, i284 int, i285 int, i286
|
|
||||||
int, i287 int, i288 int, i289 int, i290 int, i291 int, i292 int, i293 int, i294
|
|
||||||
int, i295 int, i296 int, i297 int, i298 int, i299 int, i300 int, i301 int, i302
|
|
||||||
int, i303 int, i304 int, i305 int, i306 int, i307 int, i308 int, i309 int, i310
|
|
||||||
int, i311 int, i312 int, i313 int, i314 int, i315 int, i316 int, i317 int, i318
|
|
||||||
int, i319 int, i320 int, i321 int, i322 int, i323 int, i324 int, i325 int, i326
|
|
||||||
int, i327 int, i328 int, i329 int, i330 int, i331 int, i332 int, i333 int, i334
|
|
||||||
int, i335 int, i336 int, i337 int, i338 int, i339 int, i340 int, i341 int, i342
|
|
||||||
int, i343 int, i344 int, i345 int, i346 int, i347 int, i348 int, i349 int, i350
|
|
||||||
int, i351 int, i352 int, i353 int, i354 int, i355 int, i356 int, i357 int, i358
|
|
||||||
int, i359 int, i360 int, i361 int, i362 int, i363 int, i364 int, i365 int, i366
|
|
||||||
int, i367 int, i368 int, i369 int, i370 int, i371 int, i372 int, i373 int, i374
|
|
||||||
int, i375 int, i376 int, i377 int, i378 int, i379 int, i380 int, i381 int, i382
|
|
||||||
int, i383 int, i384 int, i385 int, i386 int, i387 int, i388 int, i389 int, i390
|
|
||||||
int, i391 int, i392 int, i393 int, i394 int, i395 int, i396 int, i397 int, i398
|
|
||||||
int, i399 int, i400 int, i401 int, i402 int, i403 int, i404 int, i405 int, i406
|
|
||||||
int, i407 int, i408 int, i409 int, i410 int, i411 int, i412 int, i413 int, i414
|
|
||||||
int, i415 int, i416 int, i417 int, i418 int, i419 int, i420 int, i421 int, i422
|
|
||||||
int, i423 int, i424 int, i425 int, i426 int, i427 int, i428 int, i429 int, i430
|
|
||||||
int, i431 int, i432 int, i433 int, i434 int, i435 int, i436 int, i437 int, i438
|
|
||||||
int, i439 int, i440 int, i441 int, i442 int, i443 int, i444 int, i445 int, i446
|
|
||||||
int, i447 int, i448 int, i449 int, i450 int, i451 int, i452 int, i453 int, i454
|
|
||||||
int, i455 int, i456 int, i457 int, i458 int, i459 int, i460 int, i461 int, i462
|
|
||||||
int, i463 int, i464 int, i465 int, i466 int, i467 int, i468 int, i469 int, i470
|
|
||||||
int, i471 int, i472 int, i473 int, i474 int, i475 int, i476 int, i477 int, i478
|
|
||||||
int, i479 int, i480 int, i481 int, i482 int, i483 int, i484 int, i485 int, i486
|
|
||||||
int, i487 int, i488 int, i489 int, i490 int, i491 int, i492 int, i493 int, i494
|
|
||||||
int, i495 int, i496 int, i497 int, i498 int, i499 int, i500 int, i501 int, i502
|
|
||||||
int, i503 int, i504 int, i505 int, i506 int, i507 int, i508 int, i509 int, i510
|
|
||||||
int, i511 int, i512 int, i513 int, i514 int, i515 int, i516 int, i517 int, i518
|
|
||||||
int, i519 int, i520 int, i521 int, i522 int, i523 int, i524 int, i525 int, i526
|
|
||||||
int, i527 int, i528 int, i529 int, i530 int, i531 int, i532 int, i533 int, i534
|
|
||||||
int, i535 int, i536 int, i537 int, i538 int, i539 int, i540 int, i541 int, i542
|
|
||||||
int, i543 int, i544 int, i545 int, i546 int, i547 int, i548 int, i549 int, i550
|
|
||||||
int, i551 int, i552 int, i553 int, i554 int, i555 int, i556 int, i557 int, i558
|
|
||||||
int, i559 int, i560 int, i561 int, i562 int, i563 int, i564 int, i565 int, i566
|
|
||||||
int, i567 int, i568 int, i569 int, i570 int, i571 int, i572 int, i573 int, i574
|
|
||||||
int, i575 int, i576 int, i577 int, i578 int, i579 int, i580 int, i581 int, i582
|
|
||||||
int, i583 int, i584 int, i585 int, i586 int, i587 int, i588 int, i589 int, i590
|
|
||||||
int, i591 int, i592 int, i593 int, i594 int, i595 int, i596 int, i597 int, i598
|
|
||||||
int, i599 int, i600 int, i601 int, i602 int, i603 int, i604 int, i605 int, i606
|
|
||||||
int, i607 int, i608 int, i609 int, i610 int, i611 int, i612 int, i613 int, i614
|
|
||||||
int, i615 int, i616 int, i617 int, i618 int, i619 int, i620 int, i621 int, i622
|
|
||||||
int, i623 int, i624 int, i625 int, i626 int, i627 int, i628 int, i629 int, i630
|
|
||||||
int, i631 int, i632 int, i633 int, i634 int, i635 int, i636 int, i637 int, i638
|
|
||||||
int, i639 int, i640 int, i641 int, i642 int, i643 int, i644 int, i645 int, i646
|
|
||||||
int, i647 int, i648 int, i649 int, i650 int, i651 int, i652 int, i653 int, i654
|
|
||||||
int, i655 int, i656 int, i657 int, i658 int, i659 int, i660 int, i661 int, i662
|
|
||||||
int, i663 int, i664 int, i665 int, i666 int, i667 int, i668 int, i669 int, i670
|
|
||||||
int, i671 int, i672 int, i673 int, i674 int, i675 int, i676 int, i677 int, i678
|
|
||||||
int, i679 int, i680 int, i681 int, i682 int, i683 int, i684 int, i685 int, i686
|
|
||||||
int, i687 int, i688 int, i689 int, i690 int, i691 int, i692 int, i693 int, i694
|
|
||||||
int, i695 int, i696 int, i697 int, i698 int, i699 int, i700 int, i701 int, i702
|
|
||||||
int, i703 int, i704 int, i705 int, i706 int, i707 int, i708 int, i709 int, i710
|
|
||||||
int, i711 int, i712 int, i713 int, i714 int, i715 int, i716 int, i717 int, i718
|
|
||||||
int, i719 int, i720 int, i721 int, i722 int, i723 int, i724 int, i725 int, i726
|
|
||||||
int, i727 int, i728 int, i729 int, i730 int, i731 int, i732 int, i733 int, i734
|
|
||||||
int, i735 int, i736 int, i737 int, i738 int, i739 int, i740 int, i741 int, i742
|
|
||||||
int, i743 int, i744 int, i745 int, i746 int, i747 int, i748 int, i749 int, i750
|
|
||||||
int, i751 int, i752 int, i753 int, i754 int, i755 int, i756 int, i757 int, i758
|
|
||||||
int, i759 int, i760 int, i761 int, i762 int, i763 int, i764 int, i765 int, i766
|
|
||||||
int, i767 int, i768 int, i769 int, i770 int, i771 int, i772 int, i773 int, i774
|
|
||||||
int, i775 int, i776 int, i777 int, i778 int, i779 int, i780 int, i781 int, i782
|
|
||||||
int, i783 int, i784 int, i785 int, i786 int, i787 int, i788 int, i789 int, i790
|
|
||||||
int, i791 int, i792 int, i793 int, i794 int, i795 int, i796 int, i797 int, i798
|
|
||||||
int, i799 int, i800 int, i801 int, i802 int, i803 int, i804 int, i805 int, i806
|
|
||||||
int, i807 int, i808 int, i809 int, i810 int, i811 int, i812 int, i813 int, i814
|
|
||||||
int, i815 int, i816 int, i817 int, i818 int, i819 int, i820 int, i821 int, i822
|
|
||||||
int, i823 int, i824 int, i825 int, i826 int, i827 int, i828 int, i829 int, i830
|
|
||||||
int, i831 int, i832 int, i833 int, i834 int, i835 int, i836 int, i837 int, i838
|
|
||||||
int, i839 int, i840 int, i841 int, i842 int, i843 int, i844 int, i845 int, i846
|
|
||||||
int, i847 int, i848 int, i849 int, i850 int, i851 int, i852 int, i853 int, i854
|
|
||||||
int, i855 int, i856 int, i857 int, i858 int, i859 int, i860 int, i861 int, i862
|
|
||||||
int, i863 int, i864 int, i865 int, i866 int, i867 int, i868 int, i869 int, i870
|
|
||||||
int, i871 int, i872 int, i873 int, i874 int, i875 int, i876 int, i877 int, i878
|
|
||||||
int, i879 int, i880 int, i881 int, i882 int, i883 int, i884 int, i885 int, i886
|
|
||||||
int, i887 int, i888 int, i889 int, i890 int, i891 int, i892 int, i893 int, i894
|
|
||||||
int, i895 int, i896 int, i897 int, i898 int, i899 int, i900 int, i901 int, i902
|
|
||||||
int, i903 int, i904 int, i905 int, i906 int, i907 int, i908 int, i909 int, i910
|
|
||||||
int, i911 int, i912 int, i913 int, i914 int, i915 int, i916 int, i917 int, i918
|
|
||||||
int, i919 int, i920 int, i921 int, i922 int, i923 int, i924 int, i925 int, i926
|
|
||||||
int, i927 int, i928 int, i929 int, i930 int, i931 int, i932 int, i933 int, i934
|
|
||||||
int, i935 int, i936 int, i937 int, i938 int, i939 int, i940 int, i941 int, i942
|
|
||||||
int, i943 int, i944 int, i945 int, i946 int, i947 int, i948 int, i949 int, i950
|
|
||||||
int, i951 int, i952 int, i953 int, i954 int, i955 int, i956 int, i957 int, i958
|
|
||||||
int, i959 int, i960 int, i961 int, i962 int, i963 int, i964 int, i965 int, i966
|
|
||||||
int, i967 int, i968 int, i969 int, i970 int, i971 int, i972 int, i973 int, i974
|
|
||||||
int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
|
|
||||||
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
|
|
||||||
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
|
|
||||||
int, i999 int, i1000 int, b blob) row_format=dynamic;
|
|
||||||
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, 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, 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, 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, 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, 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, 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, "Sergei");
|
|
||||||
update t1 set b=repeat('a',256);
|
|
||||||
update t1 set i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0;
|
|
||||||
check table t1;
|
|
||||||
drop table t1;
|
|
||||||
@@ -651,4 +651,13 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE not(0+(t1.a=30 and t2.b=1));
|
|||||||
|
|
||||||
DROP TABLE t1,t2;
|
DROP TABLE t1,t2;
|
||||||
|
|
||||||
|
# Bug #8681: Bad warning message when group_concat() exceeds max length
|
||||||
|
set group_concat_max_len=5;
|
||||||
|
create table t1 (a int, b varchar(20));
|
||||||
|
create table t2 (a int, c varchar(20));
|
||||||
|
insert into t1 values (1,"aaaaaaaaaa"),(2,"bbbbbbbbbb");
|
||||||
|
insert into t2 values (1,"cccccccccc"),(2,"dddddddddd");
|
||||||
|
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by t1.a;
|
||||||
|
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
|
||||||
|
drop table t1, t2;
|
||||||
|
set group_concat_max_len=default;
|
||||||
|
|||||||
@@ -23,13 +23,15 @@ connection con2;
|
|||||||
select ((@id := kill_id) - kill_id) from t1;
|
select ((@id := kill_id) - kill_id) from t1;
|
||||||
kill @id;
|
kill @id;
|
||||||
|
|
||||||
# Wait for thread to do.
|
|
||||||
--sleep 5
|
|
||||||
# verify that con1 is doning a reconnect
|
|
||||||
connection con1;
|
connection con1;
|
||||||
--ping
|
|
||||||
--ping
|
--disable_reconnect
|
||||||
select ((@id := kill_id) - kill_id) from t1;
|
# this statement should fail
|
||||||
|
--error 2006,2013
|
||||||
|
select 1;
|
||||||
|
--enable_reconnect
|
||||||
|
# this should work, and we should have a new connection_id()
|
||||||
|
select ((@id := kill_id) - kill_id) from t1;
|
||||||
select @id != connection_id();
|
select @id != connection_id();
|
||||||
|
|
||||||
#make sure the server is still alive
|
#make sure the server is still alive
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
create table t1 (a int primary key, b int not null);
|
create table t1 (a int not null default 0 primary key, b int not null default 0);
|
||||||
insert into t1 () values (); -- Testing default values
|
insert into t1 () values (); -- Testing default values
|
||||||
insert into t1 values (1,1),(2,1),(3,1);
|
insert into t1 values (1,1),(2,1),(3,1);
|
||||||
update t1 set a=4 where b=1 limit 1;
|
update t1 set a=4 where b=1 limit 1;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ insert into t2 select * from t1;
|
|||||||
commit;
|
commit;
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=12" "xid=7"
|
--replace_result "xid=15" "xid=8"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -58,7 +58,7 @@ rollback to savepoint my_savepoint;
|
|||||||
commit;
|
commit;
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=45" "xid=24"
|
--replace_result "xid=48" "xid=25"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -76,7 +76,7 @@ commit;
|
|||||||
select a from t1 order by a; # check that savepoints work :)
|
select a from t1 order by a; # check that savepoints work :)
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=67" "xid=36"
|
--replace_result "xid=70" "xid=37"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
# and when ROLLBACK is not explicit?
|
# and when ROLLBACK is not explicit?
|
||||||
@@ -109,7 +109,7 @@ insert into t1 values(9);
|
|||||||
insert into t2 select * from t1;
|
insert into t2 select * from t1;
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=116" "xid=59"
|
--replace_result "xid=119" "xid=60"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
# Check that when the query updat1ng the MyISAM table is the first in the
|
# Check that when the query updat1ng the MyISAM table is the first in the
|
||||||
@@ -122,13 +122,13 @@ insert into t1 values(10); # first make t1 non-empty
|
|||||||
begin;
|
begin;
|
||||||
insert into t2 select * from t1;
|
insert into t2 select * from t1;
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=130" "xid=65"
|
--replace_result "xid=133" "xid=66"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
insert into t1 values(11);
|
insert into t1 values(11);
|
||||||
commit;
|
commit;
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=130" "xid=65" "xid=133" "xid=67"
|
--replace_result "xid=133" "xid=66" "xid=136" "xid=68"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
|
|
||||||
@@ -147,7 +147,7 @@ insert into t2 select * from t1;
|
|||||||
commit;
|
commit;
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=152" "xid=77"
|
--replace_result "xid=155" "xid=78"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -175,7 +175,7 @@ rollback to savepoint my_savepoint;
|
|||||||
commit;
|
commit;
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=184" "xid=93"
|
--replace_result "xid=187" "xid=94"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
delete from t1;
|
delete from t1;
|
||||||
@@ -193,7 +193,7 @@ commit;
|
|||||||
select a from t1 order by a; # check that savepoints work :)
|
select a from t1 order by a; # check that savepoints work :)
|
||||||
|
|
||||||
--replace_column 5 #
|
--replace_column 5 #
|
||||||
--replace_result "xid=205" "xid=104"
|
--replace_result "xid=208" "xid=105"
|
||||||
show binlog events from 98;
|
show binlog events from 98;
|
||||||
|
|
||||||
# Test for BUG#5714, where a MyISAM update in the transaction used to
|
# Test for BUG#5714, where a MyISAM update in the transaction used to
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ select * from t1 where b = 'two';
|
|||||||
connection server1;
|
connection server1;
|
||||||
alter table t1 drop index c;
|
alter table t1 drop index c;
|
||||||
connection server2;
|
connection server2;
|
||||||
--error 1146
|
--error 1412
|
||||||
select * from t1 where b = 'two';
|
select * from t1 where b = 'two';
|
||||||
select * from t1 where b = 'two';
|
select * from t1 where b = 'two';
|
||||||
connection server1;
|
connection server1;
|
||||||
|
|||||||
@@ -577,3 +577,30 @@ create table t1
|
|||||||
engine=ndb
|
engine=ndb
|
||||||
max_rows=1;
|
max_rows=1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test auto_increment
|
||||||
|
#
|
||||||
|
|
||||||
|
connect (con1,localhost,,,test);
|
||||||
|
connect (con2,localhost,,,test);
|
||||||
|
|
||||||
|
create table t1
|
||||||
|
(counter int(64) NOT NULL auto_increment,
|
||||||
|
datavalue char(40) default 'XXXX',
|
||||||
|
primary key (counter)
|
||||||
|
) ENGINE=ndbcluster;
|
||||||
|
|
||||||
|
connection con1;
|
||||||
|
insert into t1 (datavalue) values ('newval');
|
||||||
|
insert into t1 (datavalue) values ('newval');
|
||||||
|
select * from t1 order by counter;
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
select * from t1 order by counter;
|
||||||
|
connection con2;
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
insert into t1 (datavalue) select datavalue from t1 where counter < 100;
|
||||||
|
select * from t1 order by counter;
|
||||||
|
|
||||||
|
drop table t1;
|
||||||
|
|||||||
@@ -954,6 +954,65 @@ bin not like concat(0xBB, '%') and
|
|||||||
vbin not like concat(0xBB, '%')
|
vbin not like concat(0xBB, '%')
|
||||||
order by auto;
|
order by auto;
|
||||||
|
|
||||||
|
# Update test
|
||||||
|
update t1
|
||||||
|
set medium = 17
|
||||||
|
where
|
||||||
|
string = "aaaa" and
|
||||||
|
vstring = "aaaa" and
|
||||||
|
bin = 0xAAAA and
|
||||||
|
vbin = 0xAAAA and
|
||||||
|
tiny = -1 and
|
||||||
|
short = -1 and
|
||||||
|
medium = -1 and
|
||||||
|
long_int = -1 and
|
||||||
|
longlong = -1 and
|
||||||
|
real_float > 1.0 and real_float < 2.0 and
|
||||||
|
real_double > 1.0 and real_double < 2.0 and
|
||||||
|
real_decimal > 1.0 and real_decimal < 2.0 and
|
||||||
|
utiny = 1 and
|
||||||
|
ushort = 1 and
|
||||||
|
umedium = 1 and
|
||||||
|
ulong = 1 and
|
||||||
|
ulonglong = 1 and
|
||||||
|
/* bits = b'001' and */
|
||||||
|
options = 'one' and
|
||||||
|
flags = 'one' and
|
||||||
|
date_field = '1901-01-01' and
|
||||||
|
year_field = '1901' and
|
||||||
|
time_field = '01:01:01' and
|
||||||
|
date_time = '1901-01-01 01:01:01';
|
||||||
|
|
||||||
|
# Delete test
|
||||||
|
delete from t1
|
||||||
|
where
|
||||||
|
string = "aaaa" and
|
||||||
|
vstring = "aaaa" and
|
||||||
|
bin = 0xAAAA and
|
||||||
|
vbin = 0xAAAA and
|
||||||
|
tiny = -1 and
|
||||||
|
short = -1 and
|
||||||
|
medium = 17 and
|
||||||
|
long_int = -1 and
|
||||||
|
longlong = -1 and
|
||||||
|
real_float > 1.0 and real_float < 2.0 and
|
||||||
|
real_double > 1.0 and real_double < 2.0 and
|
||||||
|
real_decimal > 1.0 and real_decimal < 2.0 and
|
||||||
|
utiny = 1 and
|
||||||
|
ushort = 1 and
|
||||||
|
umedium = 1 and
|
||||||
|
ulong = 1 and
|
||||||
|
ulonglong = 1 and
|
||||||
|
/* bits = b'001' and */
|
||||||
|
options = 'one' and
|
||||||
|
flags = 'one' and
|
||||||
|
date_field = '1901-01-01' and
|
||||||
|
year_field = '1901' and
|
||||||
|
time_field = '01:01:01' and
|
||||||
|
date_time = '1901-01-01 01:01:01';
|
||||||
|
|
||||||
|
select count(*) from t1;
|
||||||
|
|
||||||
# Various tests
|
# Various tests
|
||||||
explain
|
explain
|
||||||
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
|
select * from t2 where attr3 is null or attr1 > 2 and pk1= 3 order by pk1;
|
||||||
|
|||||||
@@ -40,5 +40,7 @@ show status like 'handler_discover%';
|
|||||||
show tables;
|
show tables;
|
||||||
|
|
||||||
drop table t1, t2, t3, t4;
|
drop table t1, t2, t3, t4;
|
||||||
|
connection server2;
|
||||||
|
drop table t1, t3, t4;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ drop table t1;
|
|||||||
#
|
#
|
||||||
# Test inserting and updating with NULL
|
# Test inserting and updating with NULL
|
||||||
#
|
#
|
||||||
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
|
CREATE TABLE t1 (a varchar(16) NOT NULL default '', b smallint(6) NOT NULL default 0, c datetime NOT NULL default '0000-00-00 00:00:00', d smallint(6) NOT NULL default 0);
|
||||||
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
|
||||||
UPDATE t1 SET d=1/NULL;
|
UPDATE t1 SET d=1/NULL;
|
||||||
UPDATE t1 SET d=NULL;
|
UPDATE t1 SET d=NULL;
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ CREATE TABLE t1 (
|
|||||||
favo_tv varchar(50) NOT NULL default '',
|
favo_tv varchar(50) NOT NULL default '',
|
||||||
favo_eten varchar(50) NOT NULL default '',
|
favo_eten varchar(50) NOT NULL default '',
|
||||||
favo_muziek varchar(30) NOT NULL default '',
|
favo_muziek varchar(30) NOT NULL default '',
|
||||||
info text NOT NULL,
|
info text NOT NULL default '',
|
||||||
ipnr varchar(30) NOT NULL default '',
|
ipnr varchar(30) NOT NULL default '',
|
||||||
PRIMARY KEY (member_id)
|
PRIMARY KEY (member_id)
|
||||||
) ENGINE=MyISAM PACK_KEYS=1;
|
) ENGINE=MyISAM PACK_KEYS=1;
|
||||||
|
|||||||
@@ -540,3 +540,24 @@ deallocate prepare stmt;
|
|||||||
|
|
||||||
drop table t1,t2;
|
drop table t1,t2;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug#9383: INFORMATION_SCHEMA.COLUMNS, JOIN, Crash, prepared statement
|
||||||
|
#
|
||||||
|
|
||||||
|
eval SET @aux= "SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS A,
|
||||||
|
INFORMATION_SCHEMA.COLUMNS B
|
||||||
|
WHERE A.TABLE_SCHEMA = B.TABLE_SCHEMA
|
||||||
|
AND A.TABLE_NAME = B.TABLE_NAME
|
||||||
|
AND A.COLUMN_NAME = B.COLUMN_NAME AND
|
||||||
|
A.TABLE_NAME = 'user'";
|
||||||
|
|
||||||
|
let $exec_loop_count= 3;
|
||||||
|
eval prepare my_stmt from @aux;
|
||||||
|
while ($exec_loop_count)
|
||||||
|
{
|
||||||
|
eval execute my_stmt;
|
||||||
|
dec $exec_loop_count;
|
||||||
|
}
|
||||||
|
deallocate prepare my_stmt;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
-- source include/have_isam.inc
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test of REPLACE with ISAM and MyISAM and HEAP
|
# Test of REPLACE with MyISAM and HEAP
|
||||||
#
|
#
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
@@ -12,13 +10,11 @@ CREATE TABLE t1 (
|
|||||||
gesuchnr int(11) DEFAULT '0' NOT NULL,
|
gesuchnr int(11) DEFAULT '0' NOT NULL,
|
||||||
benutzer_id int(11) DEFAULT '0' NOT NULL,
|
benutzer_id int(11) DEFAULT '0' NOT NULL,
|
||||||
PRIMARY KEY (gesuchnr,benutzer_id)
|
PRIMARY KEY (gesuchnr,benutzer_id)
|
||||||
) engine=ISAM;
|
);
|
||||||
|
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (2,1);
|
replace into t1 (gesuchnr,benutzer_id) values (2,1);
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
alter table t1 engine=myisam;
|
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
|
||||||
alter table t1 engine=heap;
|
alter table t1 engine=heap;
|
||||||
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
replace into t1 (gesuchnr,benutzer_id) values (1,1);
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|||||||
@@ -73,5 +73,8 @@ connection slave;
|
|||||||
# The empty line last comes from the end line field in the file
|
# The empty line last comes from the end line field in the file
|
||||||
select * from rewrite.t1;
|
select * from rewrite.t1;
|
||||||
|
|
||||||
|
drop database rewrite;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ drop table t1;
|
|||||||
# Do a create table that tries to cover all types and options
|
# Do a create table that tries to cover all types and options
|
||||||
#
|
#
|
||||||
create table t1 (
|
create table t1 (
|
||||||
type_bool bool not null,
|
type_bool bool not null default 0,
|
||||||
type_tiny tinyint not null auto_increment primary key,
|
type_tiny tinyint not null auto_increment primary key,
|
||||||
type_short smallint(3),
|
type_short smallint(3),
|
||||||
type_mediumint mediumint,
|
type_mediumint mediumint,
|
||||||
@@ -117,9 +117,9 @@ empty_char char(0),
|
|||||||
type_char char(2),
|
type_char char(2),
|
||||||
type_varchar varchar(10),
|
type_varchar varchar(10),
|
||||||
type_timestamp timestamp not null,
|
type_timestamp timestamp not null,
|
||||||
type_date date not null,
|
type_date date not null default '0000-00-00',
|
||||||
type_time time not null,
|
type_time time not null default '00:00:00',
|
||||||
type_datetime datetime not null,
|
type_datetime datetime not null default '0000-00-00 00:00:00',
|
||||||
type_year year,
|
type_year year,
|
||||||
type_enum enum ('red', 'green', 'blue'),
|
type_enum enum ('red', 'green', 'blue'),
|
||||||
type_set enum ('red', 'green', 'blue'),
|
type_set enum ('red', 'green', 'blue'),
|
||||||
|
|||||||
@@ -696,6 +696,101 @@ create procedure bug6600()
|
|||||||
create procedure bug6600()
|
create procedure bug6600()
|
||||||
unlock table t1|
|
unlock table t1|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#9566: explicit LOCK TABLE and store procedures result in illegal state
|
||||||
|
#
|
||||||
|
# We should not think that mysql.proc table does not exist if we are unable
|
||||||
|
# to open it under LOCK TABLE or in prelocked mode. Probably this test
|
||||||
|
# should be removed when Monty will allow access to mysql.proc without
|
||||||
|
# locking it.
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
drop procedure if exists bug9566|
|
||||||
|
--enable_warnings
|
||||||
|
create procedure bug9566()
|
||||||
|
begin
|
||||||
|
select * from t1;
|
||||||
|
end|
|
||||||
|
lock table t1 read|
|
||||||
|
# This should fail because we forgot to lock mysql.proc table explicitly
|
||||||
|
--error 1100
|
||||||
|
call bug9566()|
|
||||||
|
unlock tables|
|
||||||
|
# This should succeed
|
||||||
|
drop procedure bug9566|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#7299: Stored procedures: exception handler catches not-found conditions
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
drop procedure if exists bug7299|
|
||||||
|
--enable_warnings
|
||||||
|
create procedure bug7299()
|
||||||
|
begin
|
||||||
|
declare v int;
|
||||||
|
declare c cursor for select val from t1;
|
||||||
|
declare exit handler for sqlexception select 'Error!';
|
||||||
|
|
||||||
|
open c;
|
||||||
|
fetch c into v;
|
||||||
|
end|
|
||||||
|
|
||||||
|
delete from t1|
|
||||||
|
--error ER_SP_FETCH_NO_DATA
|
||||||
|
call bug7299()|
|
||||||
|
drop procedure bug7299|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#9073: Able to declare two handlers for same condition in same scope
|
||||||
|
#
|
||||||
|
--error ER_SP_DUP_HANDLER
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlexception select 1;
|
||||||
|
declare continue handler for sqlexception select 2;
|
||||||
|
end|
|
||||||
|
--error ER_SP_DUP_HANDLER
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for 1234;
|
||||||
|
declare continue handler for condname1 select 1;
|
||||||
|
declare exit handler for condname1 select 2;
|
||||||
|
end|
|
||||||
|
--error ER_SP_DUP_HANDLER
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for sqlstate '42000';
|
||||||
|
declare condname2 condition for sqlstate '42000';
|
||||||
|
declare exit handler for condname1 select 1;
|
||||||
|
declare continue handler for condname2 select 2;
|
||||||
|
end|
|
||||||
|
--error ER_SP_DUP_HANDLER
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for sqlstate '42000';
|
||||||
|
declare exit handler for condname1 select 1;
|
||||||
|
declare exit handler for sqlstate '42000' select 2;
|
||||||
|
end|
|
||||||
|
|
||||||
|
# This should still work.
|
||||||
|
--disable_warnings
|
||||||
|
drop procedure if exists bug9073|
|
||||||
|
--enable_warnings
|
||||||
|
create procedure bug9073()
|
||||||
|
begin
|
||||||
|
declare condname1 condition for sqlstate '42000';
|
||||||
|
declare continue handler for condname1 select 1;
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlstate '42000' select 2;
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlstate '42000' select 3;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end|
|
||||||
|
drop procedure bug9073|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# BUG#NNNN: New bug synopsis
|
# BUG#NNNN: New bug synopsis
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ use test;
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
create table t1 (
|
create table t1 (
|
||||||
id char(16) not null,
|
id char(16) not null default '',
|
||||||
data int not null
|
data int not null
|
||||||
);
|
);
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
@@ -3398,6 +3398,89 @@ drop procedure bug8937|
|
|||||||
delete from t1|
|
delete from t1|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# BUG#6900: Stored procedure inner handler ignored
|
||||||
|
# BUG#9074: STORED PROC: The scope of every handler declared is not
|
||||||
|
# properly applied
|
||||||
|
#
|
||||||
|
--disable_warnings
|
||||||
|
drop procedure if exists bug6900|
|
||||||
|
drop procedure if exists bug9074|
|
||||||
|
drop procedure if exists bug6900_9074|
|
||||||
|
drop table if exists t3|
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
create table t3 (w char unique, x char)|
|
||||||
|
insert into t3 values ('a', 'b')|
|
||||||
|
|
||||||
|
create procedure bug6900()
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlexception select '1';
|
||||||
|
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlexception select '2';
|
||||||
|
|
||||||
|
insert into t3 values ('x', 'y', 'z');
|
||||||
|
end;
|
||||||
|
end|
|
||||||
|
|
||||||
|
create procedure bug9074()
|
||||||
|
begin
|
||||||
|
declare x1, x2, x3, x4, x5, x6 int default 0;
|
||||||
|
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlstate '23000' set x5 = 1;
|
||||||
|
|
||||||
|
insert into t3 values ('a', 'b');
|
||||||
|
set x6 = 1;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin1_label:
|
||||||
|
begin
|
||||||
|
declare continue handler for sqlstate '23000' set x1 = 1;
|
||||||
|
|
||||||
|
insert into t3 values ('a', 'b');
|
||||||
|
set x2 = 1;
|
||||||
|
|
||||||
|
begin2_label:
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlstate '23000' set x3 = 1;
|
||||||
|
|
||||||
|
set x4= 1;
|
||||||
|
insert into t3 values ('a','b');
|
||||||
|
set x4= 0;
|
||||||
|
end begin2_label;
|
||||||
|
end begin1_label;
|
||||||
|
|
||||||
|
select x1, x2, x3, x4, x5, x6;
|
||||||
|
end|
|
||||||
|
|
||||||
|
create procedure bug6900_9074(z int)
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlstate '23000' select '23000';
|
||||||
|
|
||||||
|
begin
|
||||||
|
declare exit handler for sqlexception select 'sqlexception';
|
||||||
|
|
||||||
|
if z = 1 then
|
||||||
|
insert into t3 values ('a', 'b');
|
||||||
|
else
|
||||||
|
insert into t3 values ('x', 'y', 'z');
|
||||||
|
end if;
|
||||||
|
end;
|
||||||
|
end|
|
||||||
|
|
||||||
|
call bug6900()|
|
||||||
|
call bug9074()|
|
||||||
|
call bug6900_9074(0)|
|
||||||
|
call bug6900_9074(1)|
|
||||||
|
|
||||||
|
drop procedure bug6900|
|
||||||
|
drop procedure bug9074|
|
||||||
|
drop procedure bug6900_9074|
|
||||||
|
drop table t3|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# BUG#NNNN: New bug synopsis
|
# BUG#NNNN: New bug synopsis
|
||||||
#
|
#
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user