Commit 955eb2f2 authored by unknown's avatar unknown

Merge perch.ndb.mysql.com:/home/jonas/src/51-new

into  perch.ndb.mysql.com:/home/jonas/src/51-ndb

parents 5c20cae8 722d9178
...@@ -1611,3 +1611,4 @@ vio/viotest-sslconnect.cpp ...@@ -1611,3 +1611,4 @@ vio/viotest-sslconnect.cpp
vio/viotest.cpp vio/viotest.cpp
zlib/*.ds? zlib/*.ds?
zlib/*.vcproj zlib/*.vcproj
BitKeeper/etc/RESYNC_TREE
...@@ -55,7 +55,7 @@ SSL_LIBRARY=--with-openssl ...@@ -55,7 +55,7 @@ SSL_LIBRARY=--with-openssl
global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings" global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings"
#debug_extra_warnings="-Wuninitialized" #debug_extra_warnings="-Wuninitialized"
c_warnings="$global_warnings -Wunused" c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY" base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine --with-partition $SSL_LIBRARY"
max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-embedded-server --with-big-tables --with-partition $SSL_LIBRARY" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-embedded-server --with-big-tables --with-partition $SSL_LIBRARY"
......
...@@ -74,5 +74,6 @@ hours: ...@@ -74,5 +74,6 @@ hours:
[jonas:]checkout:get [jonas:]checkout:get
[tomas:]checkout:get [tomas:]checkout:get
[guilhem:]checkout:get [guilhem:]checkout:get
[pekka:]checkout:get
checkout:edit checkout:edit
eoln:unix eoln:unix
...@@ -226,6 +226,33 @@ ...@@ -226,6 +226,33 @@
PreprocessorDefinitions=""/> PreprocessorDefinitions=""/>
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\sql-common\my_user.c">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="classic|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib mysqlclient.lib mysys.lib" AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
OutputFile="../client_release/mysqlslap.exe" OutputFile="../client_release/mysqlslap.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib mysqlclient.lib mysys.lib" AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
OutputFile="../client_classic/mysqlslap.exe" OutputFile="../client_classic/mysqlslap.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
Name="VCCustomBuildTool"/> Name="VCCustomBuildTool"/>
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib mysqlclient.lib mysys.lib" AdditionalDependencies="wsock32.lib odbc32.lib odbccp32.lib"
OutputFile="../client_debug/mysqlslap.exe" OutputFile="../client_debug/mysqlslap.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
......
...@@ -290,6 +290,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdb", "storage\bdb\bdb.vcpr ...@@ -290,6 +290,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdb", "storage\bdb\bdb.vcpr
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlslap", "client\mysqlslap.vcproj", "{2E9332CF-072A-4381-BF37-17C5AB4F8583}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mysqlslap", "client\mysqlslap.vcproj", "{2E9332CF-072A-4381-BF37-17C5AB4F8583}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{26383276-4843-494B-8BE0-8936ED3EBAAB} = {26383276-4843-494B-8BE0-8936ED3EBAAB}
{44D9C7DC-6636-4B82-BD01-6876C64017DF} = {44D9C7DC-6636-4B82-BD01-6876C64017DF}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "archive", "storage\archive\archive.vcproj", "{4471CADD-737B-4AD7-A108-2FBAA1C4B03B}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "archive", "storage\archive\archive.vcproj", "{4471CADD-737B-4AD7-A108-2FBAA1C4B03B}"
...@@ -1046,8 +1048,8 @@ Global ...@@ -1046,8 +1048,8 @@ Global
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic.Build.0 = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.ActiveCfg = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.classic nt.Build.0 = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.ActiveCfg = TLS_DEBUG|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.ActiveCfg = Debug|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.Build.0 = TLS_DEBUG|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Debug.Build.0 = Debug|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.ActiveCfg = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.ActiveCfg = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Classic.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.ActiveCfg = Debug|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Debug.ActiveCfg = Debug|Win32
...@@ -1058,10 +1060,10 @@ Global ...@@ -1058,10 +1060,10 @@ Global
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_ProGPL.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_ProGPL.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.ActiveCfg = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = Release|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Embedded_Release.Build.0 = Release|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.ActiveCfg = Max|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max.Build.0 = Max|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.ActiveCfg = Max|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.Max nt.Build.0 = Max|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.ActiveCfg = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.Build.0 = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.nt.Build.0 = TLS|Win32
{44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.ActiveCfg = TLS|Win32 {44D9C7DC-6636-4B82-BD01-6876C64017DF}.pro.ActiveCfg = TLS|Win32
...@@ -1540,10 +1542,10 @@ Global ...@@ -1540,10 +1542,10 @@ Global
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Embedded_ProGPL.Build.0 = Release|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Embedded_ProGPL.Build.0 = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Embedded_Release.ActiveCfg = Release|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Embedded_Release.ActiveCfg = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Embedded_Release.Build.0 = Release|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Embedded_Release.Build.0 = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max.ActiveCfg = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max.ActiveCfg = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max.Build.0 = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max.Build.0 = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max nt.ActiveCfg = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max nt.ActiveCfg = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max nt.Build.0 = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.Max nt.Build.0 = Release|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.nt.ActiveCfg = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.nt.ActiveCfg = TLS|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.nt.Build.0 = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.nt.Build.0 = TLS|Win32
{13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.pro.ActiveCfg = TLS|Win32 {13A3EB35-EF87-42DC-AFD6-CDF5EFB228AD}.pro.ActiveCfg = TLS|Win32
...@@ -1684,10 +1686,10 @@ Global ...@@ -1684,10 +1686,10 @@ Global
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_ProGPL.Build.0 = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_ProGPL.Build.0 = Debug|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Release.ActiveCfg = Release|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Release.ActiveCfg = Release|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Release.Build.0 = Release|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Embedded_Release.Build.0 = Release|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max.ActiveCfg = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max.ActiveCfg = Release|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max.Build.0 = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max.Build.0 = Release|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max nt.ActiveCfg = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max nt.ActiveCfg = Release|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max nt.Build.0 = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.Max nt.Build.0 = Release|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.nt.ActiveCfg = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.nt.ActiveCfg = Debug|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.nt.Build.0 = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.nt.Build.0 = Debug|Win32
{2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro.ActiveCfg = Debug|Win32 {2E9332CF-072A-4381-BF37-17C5AB4F8583}.pro.ActiveCfg = Debug|Win32
......
This diff is collapsed.
...@@ -94,7 +94,8 @@ static my_bool verbose=0,tFlag=0,dFlag=0,quick= 1, extended_insert= 1, ...@@ -94,7 +94,8 @@ static my_bool verbose=0,tFlag=0,dFlag=0,quick= 1, extended_insert= 1,
opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0, opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0,
opt_complete_insert= 0, opt_drop_database= 0, opt_complete_insert= 0, opt_drop_database= 0,
opt_replace_into= 0, opt_replace_into= 0,
opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1; opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1,
opt_alltspcs=0;
static ulong opt_max_allowed_packet, opt_net_buffer_length; static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0; static MYSQL mysql_connection,*sock=0;
static my_bool insert_pat_inited=0; static my_bool insert_pat_inited=0;
...@@ -162,6 +163,10 @@ static struct my_option my_long_options[] = ...@@ -162,6 +163,10 @@ static struct my_option my_long_options[] =
"Dump all the databases. This will be same as --databases with all databases selected.", "Dump all the databases. This will be same as --databases with all databases selected.",
(gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, (gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0}, 0, 0},
{"all-tablespaces", 'Y',
"Dump all the tablespaces.",
(gptr*) &opt_alltspcs, (gptr*) &opt_alltspcs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.", {"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.",
(gptr*) &opt_drop_database, (gptr*) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, (gptr*) &opt_drop_database, (gptr*) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0}, 0},
...@@ -2471,6 +2476,131 @@ static char *getTableName(int reset) ...@@ -2471,6 +2476,131 @@ static char *getTableName(int reset)
} /* getTableName */ } /* getTableName */
/*
dump all logfile groups and tablespaces
*/
static int dump_all_tablespaces()
{
MYSQL_ROW row;
MYSQL_RES *tableres;
int result=0;
char buf[FN_REFLEN];
int first;
if (mysql_query_with_error_report(sock, &tableres,
"SELECT DISTINCT"
" LOGFILE_GROUP_NAME,"
" FILE_NAME,"
" TOTAL_EXTENTS,"
" INITIAL_SIZE,"
" ENGINE"
" FROM INFORMATION_SCHEMA.FILES"
" WHERE FILE_TYPE = \"UNDO LOG\""
" ORDER BY LOGFILE_GROUP_NAME"))
return 1;
buf[0]= 0;
while ((row= mysql_fetch_row(tableres)))
{
if (strcmp(buf, row[0]) != 0)
first= 1;
if (first)
{
if (!opt_xml && opt_comments)
{
fprintf(md_result_file,"\n--\n-- Logfile group: %s\n--\n", row[0]);
check_io(md_result_file);
}
fprintf(md_result_file, "\nCREATE");
}
else
{
fprintf(md_result_file, "\nALTER");
}
fprintf(md_result_file,
" LOGFILE GROUP %s\n"
" ADD UNDOFILE '%s'\n",
row[0],
row[1]);
if (first)
{
fprintf(md_result_file,
" UNDO_BUFFER_SIZE %s\n",
row[2]);
}
fprintf(md_result_file,
" INITIAL_SIZE %s\n"
" ENGINE=%s;\n",
row[3],
row[4]);
check_io(md_result_file);
if (first)
{
first= 0;
strxmov(buf, row[0], NullS);
}
}
if (mysql_query_with_error_report(sock, &tableres,
"SELECT DISTINCT"
" TABLESPACE_NAME,"
" FILE_NAME,"
" LOGFILE_GROUP_NAME,"
" EXTENT_SIZE,"
" INITIAL_SIZE,"
" ENGINE"
" FROM INFORMATION_SCHEMA.FILES"
" WHERE FILE_TYPE = \"DATAFILE\""
" ORDER BY TABLESPACE_NAME, LOGFILE_GROUP_NAME"))
return 1;
buf[0]= 0;
while ((row= mysql_fetch_row(tableres)))
{
if (strcmp(buf, row[0]) != 0)
first= 1;
if (first)
{
if (!opt_xml && opt_comments)
{
fprintf(md_result_file,"\n--\n-- Tablespace: %s\n--\n", row[0]);
check_io(md_result_file);
}
fprintf(md_result_file, "\nCREATE");
}
else
{
fprintf(md_result_file, "\nALTER");
}
fprintf(md_result_file,
" TABLESPACE %s\n"
" ADD DATAFILE '%s'\n",
row[0],
row[1]);
if (first)
{
fprintf(md_result_file,
" USE LOGFILE GROUP %s\n"
" EXTENT_SIZE %s\n",
row[2],
row[3]);
}
fprintf(md_result_file,
" INITIAL_SIZE %s\n"
" ENGINE=%s;\n",
row[4],
row[5]);
check_io(md_result_file);
if (first)
{
first= 0;
strxmov(buf, row[0], NullS);
}
}
return 0;
}
static int dump_all_databases() static int dump_all_databases()
{ {
MYSQL_ROW row; MYSQL_ROW row;
...@@ -3348,6 +3478,9 @@ int main(int argc, char **argv) ...@@ -3348,6 +3478,9 @@ int main(int argc, char **argv)
if (opt_single_transaction && do_unlock_tables(sock)) /* unlock but no commit! */ if (opt_single_transaction && do_unlock_tables(sock)) /* unlock but no commit! */
goto err; goto err;
if (opt_alltspcs)
dump_all_tablespaces();
if (opt_alldbs) if (opt_alldbs)
dump_all_databases(); dump_all_databases();
else if (argc > 1 && !opt_databases) else if (argc > 1 && !opt_databases)
......
...@@ -1184,7 +1184,7 @@ parse_delimiter(const char *script, statement **stmt, char delm) ...@@ -1184,7 +1184,7 @@ parse_delimiter(const char *script, statement **stmt, char delm)
tmp= tmp->next) tmp= tmp->next)
{ {
count++; count++;
tmp->string= my_strdup_with_length(ptr, (size_t)(retstr - ptr), MYF(MY_FAE)); tmp->string= my_strndup(ptr, (size_t)(retstr - ptr), MYF(MY_FAE));
tmp->length= (size_t)(retstr - ptr); tmp->length= (size_t)(retstr - ptr);
DBUG_PRINT("info", (" Creating : %.*s\n", (uint)tmp->length, tmp->string)); DBUG_PRINT("info", (" Creating : %.*s\n", (uint)tmp->length, tmp->string));
ptr+= retstr - ptr + 1; ptr+= retstr - ptr + 1;
...@@ -1195,7 +1195,7 @@ parse_delimiter(const char *script, statement **stmt, char delm) ...@@ -1195,7 +1195,7 @@ parse_delimiter(const char *script, statement **stmt, char delm)
if (ptr != script+length) if (ptr != script+length)
{ {
tmp->string= my_strdup_with_length(ptr, (size_t)((script + length) - ptr), tmp->string= my_strndup(ptr, (size_t)((script + length) - ptr),
MYF(MY_FAE)); MYF(MY_FAE));
tmp->length= (size_t)((script + length) - ptr); tmp->length= (size_t)((script + length) - ptr);
DBUG_PRINT("info", (" Creating : %.*s\n", (uint)tmp->length, tmp->string)); DBUG_PRINT("info", (" Creating : %.*s\n", (uint)tmp->length, tmp->string));
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) ...@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb # remember to also change ndb version below and update version.c in ndb
AM_INIT_AUTOMAKE(mysql, 5.1.6-alpha) AM_INIT_AUTOMAKE(mysql, 5.1.7-beta)
AM_CONFIG_HEADER(config.h) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
......
...@@ -638,7 +638,7 @@ static char *get_word(char **str) ...@@ -638,7 +638,7 @@ static char *get_word(char **str)
DBUG_ENTER("get_word"); DBUG_ENTER("get_word");
*str= find_end_of_word(start); *str= find_end_of_word(start);
DBUG_RETURN(my_strdup_with_length(start, (uint) (*str - start), DBUG_RETURN(my_strndup(start, (uint) (*str - start),
MYF(MY_WME | MY_FAE))); MYF(MY_WME | MY_FAE)));
} }
...@@ -672,7 +672,7 @@ static struct message *parse_message_string(struct message *new_message, ...@@ -672,7 +672,7 @@ static struct message *parse_message_string(struct message *new_message,
while (*str != ' ' && *str != '\t' && *str) while (*str != ' ' && *str != '\t' && *str)
str++; str++;
if (!(new_message->lang_short_name= if (!(new_message->lang_short_name=
my_strdup_with_length(start, (uint) (str - start), my_strndup(start, (uint) (str - start),
MYF(MY_WME | MY_FAE)))) MYF(MY_WME | MY_FAE))))
DBUG_RETURN(0); /* Fatal error */ DBUG_RETURN(0); /* Fatal error */
DBUG_PRINT("info", ("msg_slang: %s", new_message->lang_short_name)); DBUG_PRINT("info", ("msg_slang: %s", new_message->lang_short_name));
...@@ -692,7 +692,7 @@ static struct message *parse_message_string(struct message *new_message, ...@@ -692,7 +692,7 @@ static struct message *parse_message_string(struct message *new_message,
start= str + 1; start= str + 1;
str= parse_text_line(start); str= parse_text_line(start);
if (!(new_message->text= my_strdup_with_length(start, (uint) (str - start), if (!(new_message->text= my_strndup(start, (uint) (str - start),
MYF(MY_WME | MY_FAE)))) MYF(MY_WME | MY_FAE))))
DBUG_RETURN(0); /* Fatal error */ DBUG_RETURN(0); /* Fatal error */
DBUG_PRINT("info", ("msg_text: %s", new_message->text)); DBUG_PRINT("info", ("msg_text: %s", new_message->text));
......
...@@ -24,7 +24,7 @@ pkginclude_HEADERS = my_dbug.h m_string.h my_sys.h my_list.h my_xml.h \ ...@@ -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 plugin.h $(BUILT_SOURCES) mysql_time.h plugin.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 \
heap.h my_bitmap.h\ heap.h my_bitmap.h my_uctype.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 \
......
...@@ -47,6 +47,15 @@ typedef struct unicase_info_st ...@@ -47,6 +47,15 @@ typedef struct unicase_info_st
extern MY_UNICASE_INFO *my_unicase_default[256]; extern MY_UNICASE_INFO *my_unicase_default[256];
extern MY_UNICASE_INFO *my_unicase_turkish[256]; extern MY_UNICASE_INFO *my_unicase_turkish[256];
typedef struct uni_ctype_st
{
unsigned char pctype;
unsigned char *ctype;
} MY_UNI_CTYPE;
extern MY_UNI_CTYPE my_uni_ctype[256];
#define MY_CS_ILSEQ 0 #define MY_CS_ILSEQ 0
#define MY_CS_ILUNI 0 #define MY_CS_ILUNI 0
#define MY_CS_TOOSMALL -1 #define MY_CS_TOOSMALL -1
...@@ -165,6 +174,10 @@ typedef struct my_charset_handler_st ...@@ -165,6 +174,10 @@ typedef struct my_charset_handler_st
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc, int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
unsigned char *s,unsigned char *e); unsigned char *s,unsigned char *e);
/* CTYPE scanner */
int (*ctype)(struct charset_info_st *cs, int *ctype,
const unsigned char *s, const unsigned char *e);
/* Functions for case and sort convertion */ /* Functions for case and sort convertion */
void (*caseup_str)(struct charset_info_st *, char *); void (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *); void (*casedn_str)(struct charset_info_st *, char *);
...@@ -308,6 +321,9 @@ extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *); ...@@ -308,6 +321,9 @@ extern int my_strcasecmp_8bit(CHARSET_INFO * cs, const char *, const char *);
int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e); int my_mb_wc_8bit(CHARSET_INFO *cs,my_wc_t *wc, const uchar *s,const uchar *e);
int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e); int my_wc_mb_8bit(CHARSET_INFO *cs,my_wc_t wc, uchar *s, uchar *e);
int my_mb_ctype_8bit(CHARSET_INFO *,int *, const uchar *,const uchar *);
int my_mb_ctype_mb(CHARSET_INFO *,int *, const uchar *,const uchar *);
ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq); ulong my_scan_8bit(CHARSET_INFO *cs, const char *b, const char *e, int sq);
int my_snprintf_8bit(struct charset_info_st *, char *to, uint n, int my_snprintf_8bit(struct charset_info_st *, char *to, uint n,
......
...@@ -136,7 +136,7 @@ extern int NEAR my_errno; /* Last error in mysys */ ...@@ -136,7 +136,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG) #define my_free(PTR,FLAG) _myfree((PTR), __FILE__, __LINE__,FLAG)
#define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C) #define my_memdup(A,B,C) _my_memdup((A),(B), __FILE__,__LINE__,C)
#define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C) #define my_strdup(A,C) _my_strdup((A), __FILE__,__LINE__,C)
#define my_strdup_with_length(A,B,C) _my_strdup_with_length((A),(B),__FILE__,__LINE__,C) #define my_strndup(A,B,C) _my_strndup((A),(B),__FILE__,__LINE__,C)
#define TRASH(A,B) bfill(A, B, 0x8F) #define TRASH(A,B) bfill(A, B, 0x8F)
#define QUICK_SAFEMALLOC sf_malloc_quick=1 #define QUICK_SAFEMALLOC sf_malloc_quick=1
#define NORMAL_SAFEMALLOC sf_malloc_quick=0 #define NORMAL_SAFEMALLOC sf_malloc_quick=0
...@@ -158,7 +158,7 @@ extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags); ...@@ -158,7 +158,7 @@ extern gptr my_realloc(gptr oldpoint,uint Size,myf MyFlags);
extern void my_no_flags_free(gptr ptr); extern void my_no_flags_free(gptr ptr);
extern gptr my_memdup(const byte *from,uint length,myf MyFlags); extern gptr my_memdup(const byte *from,uint length,myf MyFlags);
extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags);
extern char *my_strdup_with_length(const byte *from, uint length, extern char *my_strndup(const byte *from, uint length,
myf MyFlags); myf MyFlags);
/* we do use FG (as a no-op) in below so that a typo on FG is caught */ /* we do use FG (as a no-op) in below so that a typo on FG is caught */
#define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR)) #define my_free(PTR,FG) ((void)FG,my_no_flags_free(PTR))
...@@ -597,7 +597,7 @@ extern gptr _my_memdup(const byte *from,uint length, ...@@ -597,7 +597,7 @@ extern gptr _my_memdup(const byte *from,uint length,
const char *sFile, uint uLine,myf MyFlag); const char *sFile, uint uLine,myf MyFlag);
extern my_string _my_strdup(const char *from, const char *sFile, uint uLine, extern my_string _my_strdup(const char *from, const char *sFile, uint uLine,
myf MyFlag); myf MyFlag);
extern char *_my_strdup_with_length(const byte *from, uint length, extern char *_my_strndup(const byte *from, uint length,
const char *sFile, uint uLine, const char *sFile, uint uLine,
myf MyFlag); myf MyFlag);
......
...@@ -89,6 +89,21 @@ int my_date_to_str(const MYSQL_TIME *l_time, char *to); ...@@ -89,6 +89,21 @@ int my_date_to_str(const MYSQL_TIME *l_time, char *to);
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to); int my_datetime_to_str(const MYSQL_TIME *l_time, char *to);
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to); int my_TIME_to_str(const MYSQL_TIME *l_time, char *to);
/*
The following must be sorted so that simple intervals comes first.
(get_interval_value() depends on this)
*/
enum interval_type
{
INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR,
INTERVAL_MINUTE, INTERVAL_WEEK, INTERVAL_SECOND, INTERVAL_MICROSECOND ,
INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE,
INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND,
INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND,
INTERVAL_MINUTE_MICROSECOND, INTERVAL_SECOND_MICROSECOND
};
C_MODE_END C_MODE_END
#endif /* _my_time_h_ */ #endif /* _my_time_h_ */
This diff is collapsed.
...@@ -75,7 +75,7 @@ struct st_mysql_plugin ...@@ -75,7 +75,7 @@ struct st_mysql_plugin
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
int (*init)(void); /* the function to invoke when plugin is loaded */ int (*init)(void); /* the function to invoke when plugin is loaded */
int (*deinit)(void); /* the function to invoke when plugin is unloaded */ int (*deinit)(void); /* the function to invoke when plugin is unloaded */
uint version; /* plugin version (for SHOW PLUGINS) */ unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars; struct st_mysql_show_var *status_vars;
}; };
...@@ -176,11 +176,11 @@ typedef struct st_mysql_ftparser_boolean_info ...@@ -176,11 +176,11 @@ typedef struct st_mysql_ftparser_boolean_info
enum enum_ft_token_type type; enum enum_ft_token_type type;
int yesno; int yesno;
int weight_adjust; int weight_adjust;
bool wasign; char wasign;
bool trunc; char trunc;
/* These are parser state and must be removed. */ /* These are parser state and must be removed. */
byte prev; char prev;
byte *quot; char *quot;
} MYSQL_FTPARSER_BOOLEAN_INFO; } MYSQL_FTPARSER_BOOLEAN_INFO;
...@@ -224,14 +224,14 @@ typedef struct st_mysql_ftparser_boolean_info ...@@ -224,14 +224,14 @@ typedef struct st_mysql_ftparser_boolean_info
typedef struct st_mysql_ftparser_param typedef struct st_mysql_ftparser_param
{ {
int (*mysql_parse)(void *param, byte *doc, uint doc_len); int (*mysql_parse)(void *param, char *doc, int doc_len);
int (*mysql_add_word)(void *param, byte *word, uint word_len, int (*mysql_add_word)(void *param, char *word, int word_len,
MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info);
void *ftparser_state; void *ftparser_state;
void *mysql_ftparam; void *mysql_ftparam;
CHARSET_INFO *cs; struct charset_info_st *cs;
byte *doc; char *doc;
uint length; int length;
int mode; int mode;
} MYSQL_FTPARSER_PARAM; } MYSQL_FTPARSER_PARAM;
......
...@@ -46,6 +46,8 @@ C_MODE_START ...@@ -46,6 +46,8 @@ C_MODE_START
static my_bool emb_read_query_result(MYSQL *mysql); static my_bool emb_read_query_result(MYSQL *mysql);
C_MODE_END
void THD::clear_data_list() void THD::clear_data_list()
{ {
while (first_data) while (first_data)
...@@ -59,6 +61,7 @@ void THD::clear_data_list() ...@@ -59,6 +61,7 @@ void THD::clear_data_list()
cur_data= 0; cur_data= 0;
} }
C_MODE_START
/* /*
Reads error information from the MYSQL_DATA and puts Reads error information from the MYSQL_DATA and puts
......
-- require r/have_partition.require -- require r/have_partition.require
disable_query_log; disable_query_log;
show variables like "have_partition_engine"; show variables like "have_partitioning";
enable_query_log; enable_query_log;
...@@ -23,6 +23,7 @@ CREATE TABLE db ( ...@@ -23,6 +23,7 @@ CREATE TABLE db (
Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
PRIMARY KEY Host (Host,Db,User), PRIMARY KEY Host (Host,Db,User),
KEY User (User) KEY User (User)
) engine=MyISAM ) engine=MyISAM
...@@ -30,8 +31,8 @@ CHARACTER SET utf8 COLLATE utf8_bin ...@@ -30,8 +31,8 @@ CHARACTER SET utf8 COLLATE utf8_bin
comment='Database privileges'; comment='Database privileges';
INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y'); INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y','Y','Y','Y','N','N','Y','Y');
CREATE TABLE host ( CREATE TABLE host (
...@@ -54,6 +55,7 @@ CREATE TABLE host ( ...@@ -54,6 +55,7 @@ CREATE TABLE host (
Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
PRIMARY KEY Host (Host,Db) PRIMARY KEY Host (Host,Db)
) engine=MyISAM ) engine=MyISAM
CHARACTER SET utf8 COLLATE utf8_bin CHARACTER SET utf8 COLLATE utf8_bin
...@@ -91,6 +93,7 @@ CREATE TABLE user ( ...@@ -91,6 +93,7 @@ CREATE TABLE user (
Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
ssl_cipher BLOB NOT NULL, ssl_cipher BLOB NOT NULL,
x509_issuer BLOB NOT NULL, x509_issuer BLOB NOT NULL,
...@@ -105,9 +108,9 @@ CHARACTER SET utf8 COLLATE utf8_bin ...@@ -105,9 +108,9 @@ CHARACTER SET utf8 COLLATE utf8_bin
comment='Users and global privileges'; comment='Users and global privileges';
INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO user VALUES ('@HOSTNAME@%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user VALUES ('@HOSTNAME@%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);
INSERT INTO user (host,user) VALUES ('localhost',''); INSERT INTO user (host,user) VALUES ('localhost','');
INSERT INTO user (host,user) VALUES ('@HOSTNAME@%',''); INSERT INTO user (host,user) VALUES ('@HOSTNAME@%','');
...@@ -139,7 +142,7 @@ CREATE TABLE tables_priv ( ...@@ -139,7 +142,7 @@ CREATE TABLE tables_priv (
Table_name char(64) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL,
Grantor char(77) DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL,
Timestamp timestamp(14), Timestamp timestamp(14),
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor) PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)
) engine=MyISAM ) engine=MyISAM
...@@ -595,8 +598,40 @@ CREATE TABLE event ( ...@@ -595,8 +598,40 @@ CREATE TABLE event (
ends DATETIME default NULL, ends DATETIME default NULL,
status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED', status ENUM('ENABLED','DISABLED') NOT NULL default 'ENABLED',
on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP',
comment varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', sql_mode set(
PRIMARY KEY (db,name) 'REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
'NOT_USED',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
'POSTGRESQL',
'ORACLE',
'MSSQL',
'DB2',
'MAXDB',
'NO_KEY_OPTIONS',
'NO_TABLE_OPTIONS',
'NO_FIELD_OPTIONS',
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO',
'NO_BACKSLASH_ESCAPES',
'STRICT_TRANS_TABLES',
'STRICT_ALL_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'INVALID_DATES',
'ERROR_FOR_DIVISION_BY_ZERO',
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT '' NOT NULL,
comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '',
PRIMARY KEY (definer, db, name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
CREATE DATABASE IF NOT EXISTS cluster_replication; CREATE DATABASE IF NOT EXISTS cluster_replication;
......
...@@ -1374,7 +1374,8 @@ sub ndbcluster_install () { ...@@ -1374,7 +1374,8 @@ sub ndbcluster_install () {
"--verbose=2", "--verbose=2",
$ndbcluster_opts, $ndbcluster_opts,
"--initial", "--initial",
"--relative-config-data-dir"], "--relative-config-data-dir",
"--core"],
"", "", "", "") ) "", "", "", "") )
{ {
mtr_error("Error ndbcluster_install"); mtr_error("Error ndbcluster_install");
...@@ -1410,7 +1411,8 @@ sub ndbcluster_start ($) { ...@@ -1410,7 +1411,8 @@ sub ndbcluster_start ($) {
if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster",
["--port=$opt_ndbcluster_port", ["--port=$opt_ndbcluster_port",
"--data-dir=$opt_vardir", "--data-dir=$opt_vardir",
"--verbose=2"], "--verbose=2",
"--core"],
"", "/dev/null", "", "") ) "", "/dev/null", "", "") )
{ {
mtr_error("Error ndbcluster_start"); mtr_error("Error ndbcluster_start");
...@@ -1467,7 +1469,8 @@ sub ndbcluster_install_slave () { ...@@ -1467,7 +1469,8 @@ sub ndbcluster_install_slave () {
"--small", "--small",
"--ndbd-nodes=1", "--ndbd-nodes=1",
"--initial", "--initial",
"--relative-config-data-dir"], "--relative-config-data-dir",
"--core"],
"", "", "", "") ) "", "", "", "") )
{ {
mtr_error("Error ndbcluster_install_slave"); mtr_error("Error ndbcluster_install_slave");
...@@ -1501,7 +1504,8 @@ sub ndbcluster_start_slave ($) { ...@@ -1501,7 +1504,8 @@ sub ndbcluster_start_slave ($) {
["--port=$opt_ndbcluster_port_slave", ["--port=$opt_ndbcluster_port_slave",
"--data-dir=$opt_vardir", "--data-dir=$opt_vardir",
"--verbose=2", "--verbose=2",
"--ndbd-nodes=1"], "--ndbd-nodes=1",
"--core"],
"", "/dev/null", "", "") ) "", "/dev/null", "", "") )
{ {
mtr_error("Error ndbcluster_start_slave"); mtr_error("Error ndbcluster_start_slave");
...@@ -2312,6 +2316,7 @@ sub mysqld_arguments ($$$$$$) { ...@@ -2312,6 +2316,7 @@ sub mysqld_arguments ($$$$$$) {
mtr_add_arg($args, "%s--ndbcluster", $prefix); mtr_add_arg($args, "%s--ndbcluster", $prefix);
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
$opt_ndbconnectstring); $opt_ndbconnectstring);
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
} }
} }
...@@ -2379,6 +2384,7 @@ sub mysqld_arguments ($$$$$$) { ...@@ -2379,6 +2384,7 @@ sub mysqld_arguments ($$$$$$) {
mtr_add_arg($args, "%s--ndbcluster", $prefix); mtr_add_arg($args, "%s--ndbcluster", $prefix);
mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix,
$opt_ndbconnectstring_slave); $opt_ndbconnectstring_slave);
mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
} }
} # end slave } # end slave
......
...@@ -1278,7 +1278,7 @@ start_ndbcluster() ...@@ -1278,7 +1278,7 @@ start_ndbcluster()
then then
NDBCLUSTER_EXTRA_OPTS="--small" NDBCLUSTER_EXTRA_OPTS="--small"
fi fi
OPTS="$NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --verbose=$NDB_VERBOSE --initial --relative-config-data-dir" OPTS="$NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --verbose=$NDB_VERBOSE --initial --relative-config-data-dir --core"
if [ "x$NDB_VERBOSE" != "x0" ] ; then if [ "x$NDB_VERBOSE" != "x0" ] ; then
echo "Starting master ndbcluster " $OPTS echo "Starting master ndbcluster " $OPTS
fi fi
...@@ -1511,7 +1511,7 @@ start_slave() ...@@ -1511,7 +1511,7 @@ start_slave()
NDBCLUSTER_EXTRA_OPTS="--small" NDBCLUSTER_EXTRA_OPTS="--small"
fi fi
OPTS="$NDBCLUSTER_OPTS_SLAVE --initial $NDBCLUSTER_EXTRA_OPTS --ndbd-nodes=1 --verbose=$NDB_VERBOSE --relative-config-data-dir" OPTS="$NDBCLUSTER_OPTS_SLAVE --initial $NDBCLUSTER_EXTRA_OPTS --ndbd-nodes=1 --verbose=$NDB_VERBOSE --relative-config-data-dir --core"
if [ "x$NDB_VERBOSE" != "x0" ] ; then if [ "x$NDB_VERBOSE" != "x0" ] ; then
echo "Starting slave ndbcluster " $OPTS echo "Starting slave ndbcluster " $OPTS
fi fi
......
...@@ -53,6 +53,7 @@ status_ndb= ...@@ -53,6 +53,7 @@ status_ndb=
ndb_diskless=0 ndb_diskless=0
ndbd_nodes=2 ndbd_nodes=2
relative_config_data_dir= relative_config_data_dir=
opt_core=
ndb_no_ord=512 ndb_no_ord=512
ndb_no_attr=2048 ndb_no_attr=2048
...@@ -118,6 +119,9 @@ while test $# -gt 0; do ...@@ -118,6 +119,9 @@ while test $# -gt 0; do
--ndbd-extra-opts=*) --ndbd-extra-opts=*)
NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"` NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"`
;; ;;
--core)
opt_core="--core"
;;
--verbose=*) --verbose=*)
VERBOSE=`echo "$1" | sed -e "s;--verbose=;;"` VERBOSE=`echo "$1" | sed -e "s;--verbose=;;"`
;; ;;
...@@ -153,10 +157,10 @@ if [ ! -f "$config_ini" ]; then ...@@ -153,10 +157,10 @@ if [ ! -f "$config_ini" ]; then
exit 1 exit 1
fi fi
exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS" exec_mgmtclient="$exec_mgmtclient --no-defaults $opt_core $NDB_MGM_EXTRA_OPTS"
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS" exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $opt_core $NDB_MGMD_EXTRA_OPTS"
exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS" exec_ndb="$exec_ndb --no-defaults $opt_core $NDBD_EXTRA_OPTS"
exec_waiter="$exec_waiter --no-defaults" exec_waiter="$exec_waiter --no-defaults $opt_core"
ndb_host="localhost" ndb_host="localhost"
ndb_mgmd_port=$port ndb_mgmd_port=$port
......
...@@ -617,3 +617,7 @@ select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn'); ...@@ -617,3 +617,7 @@ select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
i v i v
4 3r4f 4 3r4f
drop table t1; drop table t1;
create table t1 (t varchar(255) default null, key t (t(80)))
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
...@@ -11366,3 +11366,4 @@ col1 ...@@ -11366,3 +11366,4 @@ col1
a a
a a
a a
drop table t1;
...@@ -603,6 +603,11 @@ DESC t2; ...@@ -603,6 +603,11 @@ DESC t2;
Field Type Null Key Default Extra Field Type Null Key Default Extra
f2 varchar(171) YES NULL f2 varchar(171) YES NULL
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t12913 (f1 ENUM ('a','b')) AS SELECT 'a' AS f1;
SELECT * FROM t12913;
f1
a
DROP TABLE t12913;
create database mysqltest; create database mysqltest;
use mysqltest; use mysqltest;
drop database mysqltest; drop database mysqltest;
......
...@@ -4,22 +4,132 @@ drop event if exists event1; ...@@ -4,22 +4,132 @@ drop event if exists event1;
Warnings: Warnings:
Note 1305 Event event1 does not exist Note 1305 Event event1 does not exist
create event event1 on schedule every 15 minute starts now() ends date_add(now(), interval 5 hour) DO begin end; create event event1 on schedule every 15 minute starts now() ends date_add(now(), interval 5 hour) DO begin end;
alter event event1 rename to event2; alter event event1 rename to event2 enable;
alter event event2 disabled; alter event event2 disable;
alter event event2 enable;
alter event event2 on completion not preserve;
alter event event2 on schedule every 1 year on completion preserve rename to event3 comment "new comment" do begin select 1; end__
alter event event3 rename to event2;
drop event event2; drop event event2;
create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end; create event event2 on schedule every 2 second starts now() ends date_add(now(), interval 5 hour) comment "some" DO begin end;
drop event event2; drop event event2;
create event e_43 on schedule every 1 second do set @a = 5;
set global event_scheduler = 1;
select sleep(2);
sleep(2)
0
alter event e_43 do alter event e_43 do set @a = 4;
select sleep(3);
sleep(3)
0
select db, name, body, status, interval_field, interval_value from mysql.event;
db name body status interval_field interval_value
events_test e_43 set @a = 4 ENABLED SECOND 1
drop event e_43;
select sleep(1);
sleep(1)
0
set global event_scheduler = 0;
create table t_event3 (a int, b float); create table t_event3 (a int, b float);
drop event if exists event3; drop event if exists event3;
Warnings: Warnings:
Note 1305 Event event3 does not exist Note 1305 Event event3 does not exist
create event event3 on schedule every 50 + 10 minute starts date_add("20010101", interval 5 minute) ends date_add("20151010", interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20151010", interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand());
set max_allowed_packet=128000000; set max_allowed_packet=128000000;
select count(*) from t_event3; select count(*) from t_event3;
count(*) count(*)
0 0
drop event event3; drop event event3;
drop table t_event3; drop table t_event3;
create event one_event on schedule every 10 second do select 123;
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
events_test one_event root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event root@localhost select 123 RECURRING NULL 10 INTERVAL_SECOND ENABLED NOT PRESERVE
CREATE DATABASE events_test2;
CREATE USER ev_test@localhost;
GRANT ALL ON events_test.* to ev_test@localhost;
GRANT ALL on events_test2.* to ev_test@localhost;
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
REVOKE PROCESS on *.* from ev_test@localhost;
select "NEW CONNECTION";
NEW CONNECTION
NEW CONNECTION
SELECT USER(), DATABASE();
USER() DATABASE()
ev_test@localhost events_test2
SHOW GRANTS;
Grants for ev_test@localhost
GRANT USAGE ON *.* TO 'ev_test'@'localhost'
GRANT ALL PRIVILEGES ON `events_test`.* TO 'ev_test'@'localhost'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `events_test2`.* TO 'ev_test'@'localhost'
"Here comes an error:";
SHOW EVENTS;
ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
USE events_test;
"Now the list should be empty:";
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
select concat("Let's create some new events from the name of ",user());
concat("Let's create some new events from the name of ",user())
Let's create some new events from the name of ev_test@localhost
create event one_event on schedule every 20 second do select 123;
create event two_event on schedule every 20 second on completion not preserve comment "two event" do select 123;
create event three_event on schedule every 20 second on completion preserve comment "three event" do select 123;
"Now we should see 3 events:";
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
events_test one_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
"This should show us only 3 events:";
SHOW FULL EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
events_test one_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
"This should show us only 2 events:";
SHOW FULL EVENTS LIKE 't%event';
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
"This should show us no events:";
SHOW FULL EVENTS FROM test LIKE '%';
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
DROP DATABASE events_test2;
"should see 1 event:";
SHOW EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
events_test one_event root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
"we should see 4 events now:";
SHOW FULL EVENTS;
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
events_test one_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test three_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test two_event ev_test@localhost RECURRING NULL 20 INTERVAL_SECOND # # ENABLED
events_test one_event root@localhost RECURRING NULL 10 INTERVAL_SECOND # # ENABLED
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT from information_schema.events;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
NULL events_test one_event ev_test@localhost select 123 RECURRING NULL 20 INTERVAL_SECOND ENABLED NOT PRESERVE
NULL events_test three_event ev_test@localhost select 123 RECURRING NULL 20 INTERVAL_SECOND ENABLED PRESERVE three event
NULL events_test two_event ev_test@localhost select 123 RECURRING NULL 20 INTERVAL_SECOND ENABLED NOT PRESERVE two event
NULL events_test one_event root@localhost select 123 RECURRING NULL 10 INTERVAL_SECOND ENABLED NOT PRESERVE
drop event one_event;
drop event two_event;
drop event three_event;
drop user ev_test@localhost;
drop event one_event;
create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP
drop event e_26;
create event e_26 on schedule at NULL disabled do set @a = 5;
ERROR HY000: Incorrect AT value: 'NULL'
create event e_26 on schedule at 'definitely not a datetime' disabled do set @a = 5;
ERROR HY000: Incorrect AT value: 'definitely not a datetime'
set names utf8; set names utf8;
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1; create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
drop event задачка; drop event задачка;
...@@ -27,69 +137,4 @@ set event_scheduler=0; ...@@ -27,69 +137,4 @@ set event_scheduler=0;
ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
set global event_scheduler=2; set global event_scheduler=2;
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2' ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
set global event_scheduler=0;
select count(*) from mysql.event;
count(*)
0
select get_lock("test_lock1", 20);
get_lock("test_lock1", 20)
1
create event закачка on schedule every 10 hour do select get_lock("test_lock1", 20);
select count(*) from mysql.event;
count(*)
1
select release_lock("test_lock1");
release_lock("test_lock1")
1
drop event закачка;
select count(*) from mysql.event;
count(*)
0
set global event_scheduler=1;
select get_lock("test_lock2", 20);
get_lock("test_lock2", 20)
1
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
select sleep(2);
sleep(2)
0
select release_lock("test_lock2");
release_lock("test_lock2")
1
drop event закачка;
set global event_scheduler=1;
select get_lock("test_lock2_1", 20);
get_lock("test_lock2_1", 20)
1
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
select sleep(2);
sleep(2)
0
set global event_scheduler=0;
select sleep(2);
sleep(2)
0
select release_lock("test_lock2_1");
release_lock("test_lock2_1")
1
select sleep(2);
sleep(2)
0
drop event закачка21;
set global event_scheduler=1;
select get_lock("test_lock3", 20);
get_lock("test_lock3", 20)
1
create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20);
select sleep(2);
sleep(2)
0
drop event закачка;
select release_lock("test_lock3");
release_lock("test_lock3")
1
set global event_scheduler=0;
select sleep(2);
sleep(2)
0
drop database events_test; drop database events_test;
...@@ -182,13 +182,13 @@ create table t1 (a varchar(200) not null, fulltext (a)); ...@@ -182,13 +182,13 @@ create table t1 (a varchar(200) not null, fulltext (a));
insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10"); insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10");
select * from t1 where match a against ("+aaa* +bbb*" in boolean mode); select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
a a
aaa10 bbb20
aaa20 bbb15
aaa30 bbb10 aaa30 bbb10
aaa20 bbb15
aaa10 bbb20
select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode); select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode);
a a
aaa20 bbb15
aaa30 bbb10 aaa30 bbb10
aaa20 bbb15
select * from t1 where match a against ("+aaa* +ccc*" in boolean mode); select * from t1 where match a against ("+aaa* +ccc*" in boolean mode);
a a
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode); select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
...@@ -196,12 +196,12 @@ a ...@@ -196,12 +196,12 @@ a
aaa10 bbb20 aaa10 bbb20
select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode); select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode);
a a
aaa20 bbb15
aaa30 bbb10 aaa30 bbb10
aaa20 bbb15
select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode); select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode);
a a
aaa20 bbb15
aaa30 bbb10 aaa30 bbb10
aaa20 bbb15
drop table t1; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
id int(11), id int(11),
......
...@@ -11,8 +11,8 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3 ...@@ -11,8 +11,8 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
grant delete on mysqltest.* to mysqltest_1@localhost; grant delete on mysqltest.* to mysqltest_1@localhost;
select * from mysql.user where user="mysqltest_1"; select * from mysql.user where user="mysqltest_1";
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0 localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
show grants for mysqltest_1@localhost; show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
...@@ -42,15 +42,15 @@ delete from mysql.user where user='mysqltest_1'; ...@@ -42,15 +42,15 @@ delete from mysql.user where user='mysqltest_1';
flush privileges; flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
select * from mysql.user where user="mysqltest_1"; select * from mysql.user where user="mysqltest_1";
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0 localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
show grants for mysqltest_1@localhost; show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
select * from mysql.user where user="mysqltest_1"; select * from mysql.user where user="mysqltest_1";
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0 localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
show grants for mysqltest_1@localhost; show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
...@@ -85,7 +85,7 @@ revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; ...@@ -85,7 +85,7 @@ revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost; show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION
revoke all privileges on mysqltest.* from mysqltest_1@localhost; revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1'; delete from mysql.user where user='mysqltest_1';
flush privileges; flush privileges;
...@@ -465,6 +465,7 @@ Show databases Server Admin To see all databases with SHOW DATABASES ...@@ -465,6 +465,7 @@ Show databases Server Admin To see all databases with SHOW DATABASES
Show view Tables To see views with SHOW CREATE VIEW Show view Tables To see views with SHOW CREATE VIEW
Shutdown Server Admin To shut down the server Shutdown Server Admin To shut down the server
Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
Trigger Tables To use triggers
Update Tables To update existing rows Update Tables To update existing rows
Usage Server Admin No privileges - allow connect only Usage Server Admin No privileges - allow connect only
create database mysqltest; create database mysqltest;
...@@ -491,8 +492,8 @@ SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY ...@@ -491,8 +492,8 @@ SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
TABLE_SCHEMA TABLE_NAME PRIVILEGES TABLE_SCHEMA TABLE_NAME PRIVILEGES
mysqltest dummytable ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE mysqltest dummytable ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, TRIGGER, UPDATE
mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, TRIGGER, UPDATE
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
SHOW GRANTS FOR dummy@localhost; SHOW GRANTS FOR dummy@localhost;
Grants for dummy@localhost Grants for dummy@localhost
...@@ -503,8 +504,8 @@ SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY ...@@ -503,8 +504,8 @@ SELECT TABLE_SCHEMA, TABLE_NAME, GROUP_CONCAT(PRIVILEGE_TYPE ORDER BY
PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE PRIVILEGE_TYPE SEPARATOR ', ') AS PRIVILEGES FROM TABLE_PRIVILEGES WHERE GRANTEE
= '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME; = '\'dummy\'@\'localhost\'' GROUP BY TABLE_SCHEMA, TABLE_NAME;
TABLE_SCHEMA TABLE_NAME PRIVILEGES TABLE_SCHEMA TABLE_NAME PRIVILEGES
mysqltest dummytable ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE mysqltest dummytable ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, TRIGGER, UPDATE
mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, UPDATE mysqltest dummyview ALTER, CREATE, CREATE VIEW, DELETE, DROP, INDEX, INSERT, REFERENCES, SELECT, SHOW VIEW, TRIGGER, UPDATE
SHOW FIELDS FROM mysql.tables_priv; SHOW FIELDS FROM mysql.tables_priv;
Field Type Null Key Default Extra Field Type Null Key Default Extra
Host char(60) NO PRI Host char(60) NO PRI
...@@ -513,7 +514,7 @@ User char(16) NO PRI ...@@ -513,7 +514,7 @@ User char(16) NO PRI
Table_name char(64) NO PRI Table_name char(64) NO PRI
Grantor char(77) NO MUL Grantor char(77) NO MUL
Timestamp timestamp YES CURRENT_TIMESTAMP Timestamp timestamp YES CURRENT_TIMESTAMP
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') NO Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') NO
Column_priv set('Select','Insert','Update','References') NO Column_priv set('Select','Insert','Update','References') NO
use test; use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
...@@ -594,7 +595,7 @@ delete from tables_priv where host = '' and user = 'mysqltest_1'; ...@@ -594,7 +595,7 @@ delete from tables_priv where host = '' and user = 'mysqltest_1';
flush privileges; flush privileges;
set @user123="non-existent"; set @user123="non-existent";
select * from mysql.db where user=@user123; select * from mysql.db where user=@user123;
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv
set names koi8r; set names koi8r;
create database ; create database ;
grant select on .* to root@localhost; grant select on .* to root@localhost;
......
Variable_name Value Variable_name Value
have_partition_engine YES have_partitioning YES
...@@ -44,6 +44,8 @@ COLLATION_CHARACTER_SET_APPLICABILITY ...@@ -44,6 +44,8 @@ COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS COLUMNS
COLUMN_PRIVILEGES COLUMN_PRIVILEGES
ENGINES ENGINES
EVENTS
FILES
KEY_COLUMN_USAGE KEY_COLUMN_USAGE
PARTITIONS PARTITIONS
PLUGINS PLUGINS
...@@ -405,6 +407,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE ...@@ -405,6 +407,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_1'@'localhost' NULL test CREATE ROUTINE YES 'mysqltest_1'@'localhost' NULL test CREATE ROUTINE YES
'mysqltest_1'@'localhost' NULL test ALTER ROUTINE YES 'mysqltest_1'@'localhost' NULL test ALTER ROUTINE YES
'mysqltest_1'@'localhost' NULL test EVENT YES 'mysqltest_1'@'localhost' NULL test EVENT YES
'mysqltest_1'@'localhost' NULL test TRIGGER YES
select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%'; select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_1'@'localhost' NULL test t1 SELECT NO 'mysqltest_1'@'localhost' NULL test t1 SELECT NO
...@@ -734,7 +737,7 @@ CREATE TABLE t_crashme ( f1 BIGINT); ...@@ -734,7 +737,7 @@ CREATE TABLE t_crashme ( f1 BIGINT);
CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1; CREATE VIEW a1 (t_CRASHME) AS SELECT f1 FROM t_crashme GROUP BY f1;
CREATE VIEW a2 AS SELECT t_CRASHME FROM a1; CREATE VIEW a2 AS SELECT t_CRASHME FROM a1;
count(*) count(*)
109 111
drop view a2, a1; drop view a2, a1;
drop table t_crashme; drop table t_crashme;
select table_schema,table_name, column_name from select table_schema,table_name, column_name from
...@@ -742,6 +745,8 @@ information_schema.columns ...@@ -742,6 +745,8 @@ information_schema.columns
where data_type = 'longtext'; where data_type = 'longtext';
table_schema table_name column_name table_schema table_name column_name
information_schema COLUMNS COLUMN_TYPE information_schema COLUMNS COLUMN_TYPE
information_schema EVENTS EVENT_BODY
information_schema EVENTS SQL_MODE
information_schema PARTITIONS PARTITION_EXPRESSION information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION information_schema PARTITIONS PARTITION_DESCRIPTION
...@@ -756,6 +761,18 @@ information_schema VIEWS VIEW_DEFINITION ...@@ -756,6 +761,18 @@ information_schema VIEWS VIEW_DEFINITION
select table_name, column_name, data_type from information_schema.columns select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime'; where data_type = 'datetime';
table_name column_name data_type table_name column_name data_type
EVENTS EXECUTE_AT datetime
EVENTS STARTS datetime
EVENTS ENDS datetime
EVENTS CREATED datetime
EVENTS LAST_ALTERED datetime
EVENTS LAST_EXECUTED datetime
FILES CREATION_TIME datetime
FILES LAST_UPDATE_TIME datetime
FILES LAST_ACCESS_TIME datetime
FILES CREATE_TIME datetime
FILES UPDATE_TIME datetime
FILES CHECK_TIME datetime
PARTITIONS CREATE_TIME datetime PARTITIONS CREATE_TIME datetime
PARTITIONS UPDATE_TIME datetime PARTITIONS UPDATE_TIME datetime
PARTITIONS CHECK_TIME datetime PARTITIONS CHECK_TIME datetime
...@@ -804,6 +821,7 @@ where COLUMN_NAME='TABLE_NAME'; ...@@ -804,6 +821,7 @@ where COLUMN_NAME='TABLE_NAME';
TABLE_NAME COLUMN_NAME PRIVILEGES TABLE_NAME COLUMN_NAME PRIVILEGES
COLUMNS TABLE_NAME select COLUMNS TABLE_NAME select
COLUMN_PRIVILEGES TABLE_NAME select COLUMN_PRIVILEGES TABLE_NAME select
FILES TABLE_NAME select
KEY_COLUMN_USAGE TABLE_NAME select KEY_COLUMN_USAGE TABLE_NAME select
PARTITIONS TABLE_NAME select PARTITIONS TABLE_NAME select
STATISTICS TABLE_NAME select STATISTICS TABLE_NAME select
...@@ -817,7 +835,7 @@ flush privileges; ...@@ -817,7 +835,7 @@ flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA; SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*) table_schema count(*)
cluster_replication 1 cluster_replication 1
information_schema 19 information_schema 21
mysql 21 mysql 21
create table t1 (i int, j int); create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row create trigger trg1 before insert on t1 for each row
......
...@@ -7,6 +7,8 @@ COLLATION_CHARACTER_SET_APPLICABILITY ...@@ -7,6 +7,8 @@ COLLATION_CHARACTER_SET_APPLICABILITY
COLUMNS COLUMNS
COLUMN_PRIVILEGES COLUMN_PRIVILEGES
ENGINES ENGINES
EVENTS
FILES
KEY_COLUMN_USAGE KEY_COLUMN_USAGE
PARTITIONS PARTITIONS
PLUGINS PLUGINS
......
drop table if exists t1,t2;
create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine=innodb;
create table t2 (id int not null,s_id int not null,s varchar(200),
primary key(id)) engine=innodb;
INSERT INTO t1 VALUES (8, 1, 3);
INSERT INTO t1 VALUES (1, 2, 1);
INSERT INTO t2 VALUES (1, 0, '');
INSERT INTO t2 VALUES (8, 1, '');
commit;
DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
WHERE mm.id IS NULL;
select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
where mm.id is null lock in share mode;
id f_id f
drop table t1,t2;
create table t1 (id int not null, f_id int not null, f int not null,
primary key(id),key(f_id)) engine=innodb;
create table t2 (id int not null,s_id int not null,s varchar(200),
primary key(id),key(s_id)) engine=innodb;
INSERT INTO t1 VALUES (8, 1, 3);
INSERT INTO t1 VALUES (1, 2, 1);
INSERT INTO t2 VALUES (1, 0, '');
INSERT INTO t2 VALUES (8, 1, '');
commit;
delete ml.* from t1 as ml left join t2 as mm on (mm.s_id=ml.f_id) where mm.s is null;
select ml.* from t1 as ml left join t2 as mm on (mm.s_id=ml.f_id) where mm.s is null lock in share mode;
id f_id f
drop table t1,t2;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
commit;
set autocommit = 0;
select * from t1 lock in share mode;
a b
1 1
2 2
3 1
4 2
5 1
6 2
update t1 set b = 5 where b = 1;
set autocommit = 0;
select * from t1 where a = 2 and b = 2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
commit;
drop table t1;
...@@ -960,7 +960,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -960,7 +960,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t8 ALL NULL NULL NULL NULL 2 Using where
...@@ -1009,7 +1009,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1009,7 +1009,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where
...@@ -1059,7 +1059,7 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1059,7 +1059,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t5 ALL idx_b NULL NULL NULL 3 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where 1 SIMPLE t7 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 Using where
1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where 1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 Using where
...@@ -1467,3 +1467,17 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -1467,3 +1467,17 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ref a a 5 test.t4.b X 1 SIMPLE t6 ref a a 5 test.t4.b X
1 SIMPLE t5 ref a a 5 test.t3.b X 1 SIMPLE t5 ref a a 5 test.t3.b X
drop table t0, t1, t2, t3, t4, t5, t6, t7; drop table t0, t1, t2, t3, t4, t5, t6, t7;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, filler char(100), key(a));
insert into t2 select A.a + 10*B.a, '' from t1 A, t1 B;
create table t3 like t2;
insert into t3 select * from t2;
explain select * from t1 left join
(t2 left join t3 on (t2.a = t3.a))
on (t1.a = t2.a);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
1 SIMPLE t2 ref a a 5 test.t1.a 1
1 SIMPLE t3 ref a a 5 test.t2.a 1
drop table t1, t2, t3;
...@@ -6,8 +6,8 @@ Grants for mysqltest_1@localhost ...@@ -6,8 +6,8 @@ Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
select * from db where user = 'mysqltest_1'; select * from db where user = 'mysqltest_1';
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv
localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y
update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost'; update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
flush privileges; flush privileges;
show grants for mysqltest_1@localhost; show grants for mysqltest_1@localhost;
...@@ -15,8 +15,8 @@ Grants for mysqltest_1@localhost ...@@ -15,8 +15,8 @@ Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
select * from db where user = 'mysqltest_1'; select * from db where user = 'mysqltest_1';
Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv
localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y
delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost'; delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
flush privileges; flush privileges;
drop user mysqltest_1@localhost; drop user mysqltest_1@localhost;
......
...@@ -361,6 +361,7 @@ OK ...@@ -361,6 +361,7 @@ OK
mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c
mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool
mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
Output from mysqltest-x.inc Output from mysqltest-x.inc
Output from mysqltest-x.inc Output from mysqltest-x.inc
Output from mysqltest-x.inc Output from mysqltest-x.inc
...@@ -419,3 +420,22 @@ select-me ...@@ -419,3 +420,22 @@ select-me
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 'insertz error query' at line 1 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 'insertz error query' at line 1
drop table t1; drop table t1;
drop table t1; drop table t1;
select "b" as col1, "c" as col2;
col1 col2
b c
select "b" as col1, "b" as col2, "c" as col3;
col1 col2 col3
b b c
seled "b" bs col1, "d" bs col2;
col1 col2
b d
select "raspberry and strawberry","blackberry","tomato";
raspberry and strawberry blackberry tomato
raspberry and strawberry blackberry tomato
mysqltest: At line 1: Error parsing replace_regex "a"
mysqltest: At line 1: Error parsing replace_regex "a;"
mysqltest: At line 1: Error parsing replace_regex "a"
mysqltest: At line 1: Error parsing replace_regex "a "
mysqltest: At line 1: Error parsing replace_regex "a b"
mysqltest: At line 1: Error parsing replace_regex "/a b c"
mysqltest: At line 1: Error parsing replace_regex "/a /b c "
...@@ -8,7 +8,7 @@ a b c ...@@ -8,7 +8,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 c = 'two'; select * from t1 where c = 'two';
ERROR HY000: Can't lock file (errno: 159) ERROR HY000: Table definition has changed, please retry transaction
select * from t1 where c = 'two'; select * from t1 where c = 'two';
a b c a b c
2 two two 2 two two
......
drop database if exists mysqltest;
drop table if exists t1,t2;
drop database if exists mysqltest;
drop table if exists t1,t2;
reset master;
reset master;
create database mysqltest;
use mysqltest;
create table t1 (a int primary key) engine=ndb;
create table t2 (a int primary key) engine=ndb;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # create database mysqltest
master-bin1.000001 # Query # # use `mysqltest`; create table t1 (a int primary key) engine=ndb
master-bin1.000001 # Query # # use `test`; create table t2 (a int primary key) engine=ndb
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # create database mysqltest
master-bin.000001 # Query # # use `mysqltest`; create table t1 (a int primary key) engine=ndb
master-bin.000001 # Query # # use `test`; create table t2 (a int primary key) engine=ndb
reset master;
reset master;
alter table t2 add column (b int);
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; alter table t2 add column (b int)
reset master;
reset master;
ALTER DATABASE mysqltest CHARACTER SET latin1;
drop table mysqltest.t1;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # cluster_replication.apply_status
master-bin.000001 # Write_rows # #
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `mysqltest`; drop table `t1`
reset master;
reset master;
use test;
insert into t2 values (1,2);
drop database mysqltest;
create table t1 (a int primary key) engine=ndb;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Table_map # # test.t2
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # drop database mysqltest
master-bin1.000001 # Query # # use `test`; create table t1 (a int primary key) engine=ndb
drop table t2;
reset master;
reset master;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB;
ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB;
CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB;
ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile02.dat'
ENGINE = NDB;
DROP TABLESPACE ts1
ENGINE = NDB;
DROP LOGFILE GROUP lg1
ENGINE =NDB;
drop table t1;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M
ENGINE=NDB
master-bin1.000001 # Query # # ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB
master-bin1.000001 # Query # # CREATE TABLESPACE ts1
ADD DATAFILE 'datafile.dat'
USE LOGFILE GROUP lg1
INITIAL_SIZE 12M
ENGINE NDB
master-bin1.000001 # Query # # ALTER TABLESPACE ts1
ADD DATAFILE 'datafile02.dat'
INITIAL_SIZE = 4M
ENGINE=NDB
master-bin1.000001 # Query # # ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
ENGINE = NDB
master-bin1.000001 # Query # # ALTER TABLESPACE ts1
DROP DATAFILE 'datafile02.dat'
ENGINE = NDB
master-bin1.000001 # Query # # DROP TABLESPACE ts1
ENGINE = NDB
master-bin1.000001 # Query # # DROP LOGFILE GROUP lg1
ENGINE =NDB
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status
master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; drop table `t1`
drop table if exists t1;
drop database if exists mysqltest; drop database if exists mysqltest;
drop table if exists t1;
drop database if exists mysqltest;
create database mysqltest;
create database mysqltest; create database mysqltest;
create table mysqltest.t1 (a int primary key, b int) engine=ndb; create table mysqltest.t1 (a int primary key, b int) engine=ndb;
use mysqltest; use mysqltest;
...@@ -10,18 +6,8 @@ show tables; ...@@ -10,18 +6,8 @@ show tables;
Tables_in_mysqltest Tables_in_mysqltest
t1 t1
drop database mysqltest; drop database mysqltest;
use mysqltest;
show tables;
Tables_in_mysqltest
create database mysqltest; create database mysqltest;
create table mysqltest.t1 (c int, d int primary key) engine=ndb;
use mysqltest; use mysqltest;
show tables; show tables;
Tables_in_mysqltest Tables_in_mysqltest
t1
drop database mysqltest; drop database mysqltest;
use mysqltest;
show tables;
Tables_in_mysqltest
drop table if exists t1;
drop database if exists mysqltest;
...@@ -21,6 +21,14 @@ CREATE TABLE t1 ...@@ -21,6 +21,14 @@ CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) (pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK TABLESPACE ts1 STORAGE DISK
ENGINE=NDB; ENGINE=NDB;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`pk1` int(11) NOT NULL,
`b` int(11) NOT NULL,
`c` int(11) NOT NULL,
PRIMARY KEY (`pk1`)
) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
INSERT INTO t1 VALUES (0, 0, 0); INSERT INTO t1 VALUES (0, 0, 0);
SELECT * FROM t1; SELECT * FROM t1;
pk1 b c pk1 b c
......
...@@ -175,6 +175,7 @@ CREATE TABLE t1 ...@@ -175,6 +175,7 @@ CREATE TABLE t1
(pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL) (pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL)
TABLESPACE ts1 STORAGE DISK TABLESPACE ts1 STORAGE DISK
ENGINE NDB; ENGINE NDB;
CREATE INDEX c on t1(c);
DROP TABLE t1; DROP TABLE t1;
ALTER TABLESPACE ts1 ALTER TABLESPACE ts1
DROP DATAFILE 'datafile2.dat' DROP DATAFILE 'datafile2.dat'
......
...@@ -218,7 +218,7 @@ t2 CREATE TABLE `t2` ( ...@@ -218,7 +218,7 @@ t2 CREATE TABLE `t2` (
`b2` int(11) NOT NULL, `b2` int(11) NOT NULL,
`c2` int(11) NOT NULL, `c2` int(11) NOT NULL,
PRIMARY KEY (`pk2`) PRIMARY KEY (`pk2`)
) ENGINE=NDBCLUSTER DEFAULT CHARSET=latin1 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
SHOW CREATE TABLE test.t1; SHOW CREATE TABLE test.t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -226,7 +226,7 @@ t1 CREATE TABLE `t1` ( ...@@ -226,7 +226,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`pk1`) PRIMARY KEY (`pk1`)
) ENGINE=NDBCLUSTER DEFAULT CHARSET=latin1 ) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
ENGINE=NDB; ENGINE=NDB;
SHOW CREATE TABLE test.t2; SHOW CREATE TABLE test.t2;
...@@ -236,7 +236,7 @@ t2 CREATE TABLE `t2` ( ...@@ -236,7 +236,7 @@ t2 CREATE TABLE `t2` (
`b2` int(11) NOT NULL, `b2` int(11) NOT NULL,
`c2` int(11) NOT NULL, `c2` int(11) NOT NULL,
PRIMARY KEY (`pk2`) PRIMARY KEY (`pk2`)
) ENGINE=NDBCLUSTER DEFAULT CHARSET=latin1 ) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
ALTER TABLE test.t1 ENGINE=NDBCLUSTER; ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
SHOW CREATE TABLE test.t1; SHOW CREATE TABLE test.t1;
Table Create Table Table Create Table
...@@ -245,7 +245,7 @@ t1 CREATE TABLE `t1` ( ...@@ -245,7 +245,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`pk1`) PRIMARY KEY (`pk1`)
) ENGINE=NDBCLUSTER DEFAULT CHARSET=latin1 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 PARTITION BY KEY ()
DROP TABLE test.t1; DROP TABLE test.t1;
DROP TABLE test.t2; DROP TABLE test.t2;
......
This diff is collapsed.
...@@ -50,15 +50,9 @@ a ...@@ -50,15 +50,9 @@ a
select * from t3; select * from t3;
a b c last_col a b c last_col
1 Hi! 89 Longtext column 1 Hi! 89 Longtext column
show status like 'handler_discover%';
Variable_name Value
Handler_discover 1
show tables like 't4'; show tables like 't4';
Tables_in_test (t4) Tables_in_test (t4)
t4 t4
show status like 'handler_discover%';
Variable_name Value
Handler_discover 2
show tables; show tables;
Tables_in_test Tables_in_test
t1 t1
......
use test; use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
id type state logging database schema name
2 UserTable Online Yes cluster_replication def apply_status
1 SystemTable Online Yes sys def NDB$EVENTS_0
3 UserTable Online Yes cluster_replication def schema
0 SystemTable Online Yes sys def SYSTAB_0
NDBT_ProgramExit: 0 - OK
CREATE TABLE `t1_c` ( CREATE TABLE `t1_c` (
`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment, `capgoaledatta` smallint(5) unsigned NOT NULL auto_increment,
`goaledatta` char(2) NOT NULL default '', `goaledatta` char(2) NOT NULL default '',
......
...@@ -271,3 +271,10 @@ t1 CREATE TABLE `t1` ( ...@@ -271,3 +271,10 @@ t1 CREATE TABLE `t1` (
`b` int(11) default NULL `b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION x5 VALUES LESS THAN (12) ENGINE = MyISAM, PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM, PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM, PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (6) ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION x4 VALUES LESS THAN (10) ENGINE = MyISAM, PARTITION x5 VALUES LESS THAN (12) ENGINE = MyISAM, PARTITION x6 VALUES LESS THAN (14) ENGINE = MyISAM, PARTITION x7 VALUES LESS THAN (16) ENGINE = MyISAM, PARTITION x8 VALUES LESS THAN (18) ENGINE = MyISAM, PARTITION x9 VALUES LESS THAN (20) ENGINE = MyISAM)
drop table t1; drop table t1;
create table t1 (a int not null, b int not null) partition by LIST (a+b) (
partition p0 values in (12),
partition p1 values in (14)
);
insert into t1 values (10,1);
ERROR HY000: Table has no partition for value 11
drop table t1;
...@@ -70,3 +70,6 @@ select * from t1; ...@@ -70,3 +70,6 @@ select * from t1;
f1 f2 f1 f2
-1 ####### -1 #######
drop table t1; drop table t1;
CREATE TABLE t1 (s1 int) ENGINE=BLACKHOLE PARTITION BY HASH (s1);
INSERT INTO t1 VALUES (0);
DROP TABLE t1;
...@@ -112,3 +112,33 @@ ALTER TABLE t1 DROP PARTITION x1; ...@@ -112,3 +112,33 @@ ALTER TABLE t1 DROP PARTITION x1;
ALTER TABLE t1 DROP PARTITION x0; ALTER TABLE t1 DROP PARTITION x0;
ERROR HY000: Cannot remove all partitions, use DROP TABLE instead ERROR HY000: Cannot remove all partitions, use DROP TABLE instead
DROP TABLE t1; DROP TABLE t1;
INSERT INTO t1 VALUES (15);
DROP TABLE t1;
CREATE TABLE t1 ( id INT NOT NULL,
fname VARCHAR(50) NOT NULL,
lname VARCHAR(50) NOT NULL,
hired DATE NOT NULL )
PARTITION BY RANGE(YEAR(hired)) (
PARTITION p1 VALUES LESS THAN (1991),
PARTITION p2 VALUES LESS THAN (1996),
PARTITION p3 VALUES LESS THAN (2001),
PARTITION p4 VALUES LESS THAN (2005));
ALTER TABLE t1 ADD PARTITION (
PARTITION p5 VALUES LESS THAN (2010),
PARTITION p6 VALUES LESS THAN MAXVALUE);
DROP TABLE t1;
CREATE TABLE t1 (a INT);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 PARTITION BY KEY(a) PARTITIONS 2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY KEY (a) PARTITIONS 2
DROP TABLE t1;
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
This diff is collapsed.
...@@ -533,13 +533,13 @@ SET @aux= "SELECT COUNT(*) ...@@ -533,13 +533,13 @@ SET @aux= "SELECT COUNT(*)
prepare my_stmt from @aux; prepare my_stmt from @aux;
execute my_stmt; execute my_stmt;
COUNT(*) COUNT(*)
38 39
execute my_stmt; execute my_stmt;
COUNT(*) COUNT(*)
38 39
execute my_stmt; execute my_stmt;
COUNT(*) COUNT(*)
38 39
deallocate prepare my_stmt; deallocate prepare my_stmt;
drop procedure if exists p1| drop procedure if exists p1|
drop table if exists t1| drop table if exists t1|
...@@ -825,6 +825,40 @@ execute stmt; ...@@ -825,6 +825,40 @@ execute stmt;
drop table t1; drop table t1;
set names default; set names default;
deallocate prepare stmt; deallocate prepare stmt;
create table t1 (
word_id mediumint(8) unsigned not null default '0',
formatted varchar(20) not null default ''
);
insert into t1 values
(80,'pendant'), (475,'pretendants'), (989,'tendances'),
(1019,'cependant'),(1022,'abondance'),(1205,'independants'),
(13,'lessiver'),(25,'lambiner'),(46,'situer'),(71,'terminer'),
(82,'decrocher');
select count(*) from t1 where formatted like '%NDAN%';
count(*)
6
select count(*) from t1 where formatted like '%ER';
count(*)
5
prepare stmt from "select count(*) from t1 where formatted like ?";
set @like="%NDAN%";
execute stmt using @like;
count(*)
6
set @like="%ER";
execute stmt using @like;
count(*)
5
set @like="%NDAN%";
execute stmt using @like;
count(*)
6
set @like="%ER";
execute stmt using @like;
count(*)
5
deallocate prepare stmt;
drop table t1;
create table t1 (id int); create table t1 (id int);
prepare ins_call from "insert into t1 (id) values (1)"; prepare ins_call from "insert into t1 (id) values (1)";
execute ins_call; execute ins_call;
......
...@@ -49,7 +49,7 @@ Pos Instruction ...@@ -49,7 +49,7 @@ Pos Instruction
9 set err@1 1 9 set err@1 1
10 hreturn 5 10 hreturn 5
11 cfetch c@0 n@4 11 cfetch c@0 n@4
12 jump_if_not 15 isnull(n@4) 12 jump_if_not 15(17) isnull(n@4)
13 set nulls@2 (nulls@2 + 1) 13 set nulls@2 (nulls@2 + 1)
14 jump 17 14 jump 17
15 set count@3 (count@3 + 1) 15 set count@3 (count@3 + 1)
......
...@@ -522,7 +522,7 @@ fetch c into v; ...@@ -522,7 +522,7 @@ fetch c into v;
end| end|
delete from t1| delete from t1|
call bug7299()| call bug7299()|
ERROR 02000: No data to FETCH ERROR 02000: No data - zero rows fetched, selected, or processed
drop procedure bug7299| drop procedure bug7299|
create procedure bug9073() create procedure bug9073()
begin begin
......
This diff is collapsed.
...@@ -186,6 +186,27 @@ proc CREATE TABLE `proc` ( ...@@ -186,6 +186,27 @@ proc CREATE TABLE `proc` (
`comment` char(64) character set utf8 collate utf8_bin NOT NULL default '', `comment` char(64) character set utf8 collate utf8_bin NOT NULL default '',
PRIMARY KEY (`db`,`name`,`type`) PRIMARY KEY (`db`,`name`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
show create table event;
Table Create Table
event CREATE TABLE `event` (
`db` char(64) character set utf8 collate utf8_bin NOT NULL default '',
`name` char(64) character set utf8 collate utf8_bin NOT NULL default '',
`body` longblob NOT NULL,
`definer` char(77) character set utf8 collate utf8_bin NOT NULL default '',
`execute_at` datetime default NULL,
`interval_value` int(11) default NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL,
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_executed` datetime default NULL,
`starts` datetime default NULL,
`ends` datetime default NULL,
`status` enum('ENABLED','DISABLED') NOT NULL default 'ENABLED',
`on_completion` enum('DROP','PRESERVE') NOT NULL default 'DROP',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL default '',
`comment` char(64) character set utf8 collate utf8_bin NOT NULL default '',
PRIMARY KEY (`definer`,`db`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
show create table general_log; show create table general_log;
Table Create Table Table Create Table
general_log CREATE TABLE `general_log` ( general_log CREATE TABLE `general_log` (
...@@ -211,25 +232,5 @@ slow_log CREATE TABLE `slow_log` ( ...@@ -211,25 +232,5 @@ slow_log CREATE TABLE `slow_log` (
`server_id` int(11) default NULL, `server_id` int(11) default NULL,
`sql_text` mediumtext NOT NULL `sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show create table event;
Table Create Table
event CREATE TABLE `event` (
`db` char(64) character set utf8 collate utf8_bin NOT NULL default '',
`name` char(64) character set utf8 collate utf8_bin NOT NULL default '',
`body` longblob NOT NULL,
`definer` char(77) character set utf8 collate utf8_bin NOT NULL default '',
`execute_at` datetime default NULL,
`interval_value` int(11) default NULL,
`interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL,
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL default '0000-00-00 00:00:00',
`last_executed` datetime default NULL,
`starts` datetime default NULL,
`ends` datetime default NULL,
`status` enum('ENABLED','DISABLED') NOT NULL default 'ENABLED',
`on_completion` enum('DROP','PRESERVE') NOT NULL default 'DROP',
`comment` varchar(64) character set utf8 collate utf8_bin NOT NULL default '',
PRIMARY KEY (`db`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
show tables; show tables;
Tables_in_test Tables_in_test
...@@ -7,8 +7,7 @@ DROP DATABASE IF EXISTS mysqltest_db1; ...@@ -7,8 +7,7 @@ DROP DATABASE IF EXISTS mysqltest_db1;
CREATE DATABASE mysqltest_db1; CREATE DATABASE mysqltest_db1;
CREATE USER mysqltest_dfn@localhost; CREATE USER mysqltest_dfn@localhost;
CREATE USER mysqltest_inv@localhost; CREATE USER mysqltest_inv@localhost;
GRANT SUPER ON *.* TO mysqltest_dfn@localhost; GRANT CREATE, TRIGGER ON mysqltest_db1.* TO mysqltest_dfn@localhost;
GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
---> connection: wl2818_definer_con ---> connection: wl2818_definer_con
CREATE TABLE t1(num_value INT); CREATE TABLE t1(num_value INT);
......
This diff is collapsed.
...@@ -537,10 +537,10 @@ select @@query_prealloc_size = @test; ...@@ -537,10 +537,10 @@ select @@query_prealloc_size = @test;
create table t1 (a int); create table t1 (a int);
select a into @x from t1; select a into @x from t1;
Warnings: Warnings:
Warning 1329 No data to FETCH Warning 1329 No data - zero rows fetched, selected, or processed
show warnings; show warnings;
Level Code Message Level Code Message
Warning 1329 No data to FETCH Warning 1329 No data - zero rows fetched, selected, or processed
drop table t1; drop table t1;
set @@warning_count=1; set @@warning_count=1;
ERROR HY000: Variable 'warning_count' is a read only variable ERROR HY000: Variable 'warning_count' is a read only variable
......
...@@ -350,12 +350,12 @@ select * from v1; ...@@ -350,12 +350,12 @@ select * from v1;
f2() f2()
NULL NULL
Warnings: Warnings:
Warning 1329 No data to FETCH Warning 1329 No data - zero rows fetched, selected, or processed
select * from v2; select * from v2;
f2() f2()
NULL NULL
Warnings: Warnings:
Warning 1329 No data to FETCH Warning 1329 No data - zero rows fetched, selected, or processed
select * from v3; select * from v3;
ERROR HY000: View 'mysqltest.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ERROR HY000: View 'mysqltest.v3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
select * from v4; select * from v4;
...@@ -396,12 +396,12 @@ select * from v3; ...@@ -396,12 +396,12 @@ select * from v3;
f2() f2()
NULL NULL
Warnings: Warnings:
Warning 1329 No data to FETCH Warning 1329 No data - zero rows fetched, selected, or processed
select * from v4; select * from v4;
f2() f2()
NULL NULL
Warnings: Warnings:
Warning 1329 No data to FETCH Warning 1329 No data - zero rows fetched, selected, or processed
select * from v5; select * from v5;
ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
drop view v1, v2, v3, v4, v5; drop view v1, v2, v3, v4, v5;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--innodb_locks_unsafe_for_binlog=true
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -17,7 +17,7 @@ select * from t1 where c = 'two'; ...@@ -17,7 +17,7 @@ select * from t1 where c = 'two';
connection server1; connection server1;
alter table t1 drop index c; alter table t1 drop index c;
connection server2; connection server2;
-- error 1015 -- error 1412
select * from t1 where c = 'two'; select * from t1 where c = 'two';
select * from t1 where c = 'two'; select * from t1 where c = 'two';
connection server1; connection server1;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment