diff --git a/acinclude.m4 b/acinclude.m4 index 2e0e85743b7..28344919dae 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -241,13 +241,10 @@ dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz). AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [ AC_MSG_CHECKING([for zlib compression library]) case $SYSTEM_TYPE in -dnl This is a quick fix for Netware if AC_TRY_LINK for some reason -dnl won't work there. Uncomment in case of failure and on Netware -dnl we'll always assume that zlib is present -dnl *netware* | *modesto*) -dnl AC_MSG_RESULT(ok) -dnl AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) -dnl ;; +*netware* | *modesto*) + AC_MSG_RESULT(ok) + AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) + ;; *) AC_ARG_WITH([zlib-dir], AC_HELP_STRING([--with-zlib-dir=DIR], diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index 2e42c2f5036..a5508b23a5c 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -24,7 +24,8 @@ extern os_event_t srv_lock_timeout_thread_event; /* If the last data file is auto-extended, we add this many pages to it at a time */ -#define SRV_AUTO_EXTEND_INCREMENT (8 * ((1024 * 1024) / UNIV_PAGE_SIZE)) +#define SRV_AUTO_EXTEND_INCREMENT \ + (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE)) /* This is set to TRUE if the MySQL user has set it in MySQL */ extern ibool srv_lower_case_table_names; @@ -51,6 +52,7 @@ extern ulint* srv_data_file_is_raw_partition; extern ibool srv_auto_extend_last_data_file; extern ulint srv_last_file_size_max; +extern ulint srv_auto_extend_increment; extern ibool srv_created_new_raw; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 389cd5b779d..9b96d610f28 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -92,6 +92,9 @@ ulint srv_last_file_size_max = 0; /* if != 0, this tells the max size auto-extending may increase the last data file size */ +ulint srv_auto_extend_increment = 8; /* If the last data file is + auto-extended, we add this + many pages to it at a time */ ulint* srv_data_file_is_raw_partition = NULL; /* If the following is TRUE we do not allow inserts etc. This protects diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 4ff72d63144..11dbcca9431 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -69,6 +69,6 @@ Error 1259 ZLIB: Input data corrupted Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) drop table t1; set @@max_allowed_packet=1048576*100; -select length(compress(repeat('aaaaaaaaaa', 10000000))); -length(compress(repeat('aaaaaaaaaa', 10000000))) -97214 +select compress(repeat('aaaaaaaaaa', 10000000)) is null; +compress(repeat('aaaaaaaaaa', 10000000)) is null +0 diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 39ec9ff4eb9..780ceb36ad6 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -455,3 +455,10 @@ create table t3 (a int, primary key (a)); delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a); ERROR 42S02: Unknown table 't3' in MULTI DELETE drop table t1, t2, t3; +create table t1 (col1 int); +create table t2 (col1 int); +update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; +ERROR HY000: You can't specify target table 't1' for update in FROM clause +drop table t1,t2; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index e9a5f705fa7..2561caa3759 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -414,15 +414,15 @@ prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 63 -def table 253 64 2 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 14 N 1 31 63 +def Extra 253 255 14 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort SET @arg00=1 ; @@ -430,15 +430,15 @@ prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 63 -def table 253 64 2 N 1 31 63 -def type 253 10 5 N 1 31 63 -def possible_keys 253 4096 7 Y 0 31 63 -def key 253 64 7 Y 0 31 63 +def select_type 253 19 6 N 1 31 8 +def table 253 64 2 N 1 31 8 +def type 253 10 5 N 1 31 8 +def possible_keys 253 4096 7 Y 0 31 8 +def key 253 64 7 Y 0 31 8 def key_len 8 3 1 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 27 N 1 31 63 +def Extra 253 255 27 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort test_sequence diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index ff0b7d65433..16d3cdbbb47 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -574,15 +574,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -645,15 +645,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 6e18e3e5ec9..865b108d7ed 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -574,15 +574,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -645,15 +645,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 13bb3b26311..1cc18575dd1 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -575,15 +575,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -646,15 +646,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 6f8109d64de..2d67635cc10 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -617,15 +617,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -688,15 +688,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -1812,15 +1812,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -1883,15 +1883,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 5481ee6b4f2..8fe76dae3ab 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -574,15 +574,15 @@ prepare stmt1 from @stmt ; execute stmt1 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where @@ -645,15 +645,15 @@ execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, @arg09 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 N 32801 0 8 -def select_type 253 19 18 N 1 31 63 -def table 253 64 16 N 1 31 63 -def type 253 10 3 N 1 31 63 -def possible_keys 253 4096 0 Y 0 31 63 -def key 253 64 0 Y 0 31 63 +def select_type 253 19 18 N 1 31 8 +def table 253 64 16 N 1 31 8 +def type 253 10 3 N 1 31 8 +def possible_keys 253 4096 0 Y 0 31 8 +def key 253 64 0 Y 0 31 8 def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 63 +def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 N 32801 0 8 -def Extra 253 255 44 N 1 31 63 +def Extra 253 255 44 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 2 1 PRIMARY ALL NULL NULL NULL NULL 2 Using where diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index ff5c9dfe813..7826f5e452d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1966,5 +1966,13 @@ howmanyvalues mycount 3 3 4 4 SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues; -ERROR 42S22: Unknown column 'a.avalue' in 'where clause' +howmanyvalues mycount +1 1 +2 1 +3 1 +4 1 +drop table t1; +create table t1 (x int); +select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; +(select b.x from t1 as b where b.x=a.x) drop table t1; diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 1384ef27cd2..7b70289d2c0 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -41,4 +41,4 @@ drop table t1; # set @@max_allowed_packet=1048576*100; -select length(compress(repeat('aaaaaaaaaa', 10000000))); +select compress(repeat('aaaaaaaaaa', 10000000)) is null; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index c2814606aa2..40e742679f8 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -417,3 +417,14 @@ create table t3 (a int, primary key (a)); -- error 1109 delete t1,t3 from t1,t2 where t1.a=t2.a and t2.a=(select t3.a from t3 where t1.a=t3.a); drop table t1, t2, t3; + +# +# multi* unique updating table check +# +create table t1 (col1 int); +create table t2 (col1 int); +-- error 1093 +update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1; +-- error 1093 +delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; +drop table t1,t2; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index cbc76e02b42..c739e28849e 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -200,9 +200,9 @@ drop table t1; # create table t1 ( a int primary key, b varchar(30)) engine = MYISAM ; prepare stmt1 from ' show table status from test like ''t1%'' '; ---replace_column 12 # 13 # 14 # +--replace_column 8 4294967295 12 # 13 # 14 # execute stmt1; ---replace_column 12 # 13 # 14 # +--replace_column 8 4294967295 12 # 13 # 14 # show table status from test like 't1%' ; deallocate prepare stmt1 ; drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 7fcd0565ae7..2dc28479ee9 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1264,6 +1264,9 @@ SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.how CREATE INDEX t1_howmanyvalues_idx ON t1 (howmanyvalues); SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues+1 = a.howmanyvalues+1) as mycount from t1 a group by a.howmanyvalues; SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.howmanyvalues) as mycount from t1 a group by a.howmanyvalues; --- error 1054 SELECT a.howmanyvalues, (SELECT count(*) from t1 b where b.howmanyvalues = a.avalue) as mycount from t1 a group by a.howmanyvalues; drop table t1; + +create table t1 (x int); +select (select b.x from t1 as b where b.x=a.x) from t1 as a where a.x=2 group by a.x; +drop table t1; diff --git a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp index a3d91f9c7b1..8448d64222f 100644 --- a/ndb/src/common/portlib/NdbTCP.cpp +++ b/ndb/src/common/portlib/NdbTCP.cpp @@ -39,7 +39,14 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { /* Try it as aaa.bbb.ccc.ddd. */ dst->s_addr = inet_addr(address); - if (dst->s_addr != INADDR_NONE) { + if (dst->s_addr != +#ifdef INADDR_NONE + INADDR_NONE +#else + -1 +#endif + ) + { return 0; } return -1; diff --git a/netware/init_db.sql b/netware/init_db.sql index 5e7ace0779b..15111c9043b 100644 --- a/netware/init_db.sql +++ b/netware/init_db.sql @@ -8,9 +8,9 @@ CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DE INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) 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','','','','',0,0,0); INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @@ -30,14 +30,9 @@ CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(6 CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; -INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4); CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; -INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'); CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; -INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES(1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8); CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; -INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET'),(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET'),(2, 0, 0, 0, 'UTC'),(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST'),(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST'),(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD'),(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET'),(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD'),(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET'),(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST'),(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST'),(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD'),(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET'),(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD'),(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET'); CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; -INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3),(157766403, 4) ,(189302404, 5) ,(220924805, 6),(252460806, 7) ,(283996807, 8) ,(315532808, 9),(362793609, 10) ,(394329610, 11) ,(425865611, 12),(489024012, 13) ,(567993613, 14) ,(631152014, 15),(662688015, 16) ,(709948816, 17) ,(741484817, 18),(773020818, 19) ,(820454419, 20) ,(867715220, 21),(915148821, 22); diff --git a/netware/test_db.sql b/netware/test_db.sql index acdc3630f58..0f58c242278 100644 --- a/netware/test_db.sql +++ b/netware/test_db.sql @@ -5,9 +5,12 @@ USE mysql; CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); + +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) 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','','','','',0,0,0); INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @@ -17,12 +20,24 @@ INSERT INTO user (host,user) values ('',''); CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; -CREATE TABLE help_topic (help_topic_id int unsigned not null auto_increment, name varchar(64) not null, description text not null, example text not null, url varchar(128) not null, primary key (help_topic_id), unique index (name)) comment='help topics'; +CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics'; +CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; +CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; +CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; -CREATE TABLE help_category (help_category_id smallint unsigned not null auto_increment, name varchar(64) not null, url varchar(128) not null, primary key (help_category_id), unique index (name)) comment='help topics-categories relation'; - -CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic, help_category_id smallint unsigned not null references help_category, primary key (help_category_id, help_topic_id)) comment='categories of help topics'; +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4),('Japan', 5); + +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'); +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; +INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES(1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3) ,(1, 733280400, 2) ,(1, 749005200, 3) ,(1, 764730000, 2) ,(1, 780454800, 3) ,(1, 796179600, 2) ,(1, 811904400, 3) ,(1, 828234000, 2) ,(1, 846378000, 3) ,(1, 859683600, 2) ,(1, 877827600, 3) ,(1, 891133200, 2) ,(1, 909277200, 3) ,(1, 922582800, 2) ,(1, 941331600, 3) ,(1, 954032400, 2) ,(1, 972781200, 3) ,(1, 985482000, 2) ,(1, 1004230800, 3) ,(1, 1017536400, 2) ,(1, 1035680400, 3) ,(1, 1048986000, 2) ,(1, 1067130000, 3) ,(1, 1080435600, 2) ,(1, 1099184400, 3) ,(1, 1111885200, 2) ,(1, 1130634000, 3) ,(1, 1143334800, 2) ,(1, 1162083600, 3) ,(1, 1174784400, 2) ,(1, 1193533200, 3) ,(1, 1206838800, 2) ,(1, 1224982800, 3) ,(1, 1238288400, 2) ,(1, 1256432400, 3) ,(1, 1269738000, 2) ,(1, 1288486800, 3) ,(1, 1301187600, 2) ,(1, 1319936400, 3) ,(1, 1332637200, 2) ,(1, 1351386000, 3) ,(1, 1364691600, 2) ,(1, 1382835600, 3) ,(1, 1396141200, 2) ,(1, 1414285200, 3) ,(1, 1427590800, 2) ,(1, 1445734800, 3) ,(1, 1459040400, 2) ,(1, 1477789200, 3) ,(1, 1490490000, 2) ,(1, 1509238800, 3) ,(1, 1521939600, 2) ,(1, 1540688400, 3) ,(1, 1553994000, 2) ,(1, 1572138000, 3) ,(1, 1585443600, 2) ,(1, 1603587600, 3) ,(1, 1616893200, 2) ,(1, 1635642000, 3) ,(1, 1648342800, 2) ,(1, 1667091600, 3) ,(1, 1679792400, 2) ,(1, 1698541200, 3) ,(1, 1711846800, 2) ,(1, 1729990800, 3) ,(1, 1743296400, 2) ,(1, 1761440400, 3) ,(1, 1774746000, 2) ,(1, 1792890000, 3) ,(1, 1806195600, 2) ,(1, 1824944400, 3) ,(1, 1837645200, 2) ,(1, 1856394000, 3) ,(1, 1869094800, 2) ,(1, 1887843600, 3) ,(1, 1901149200, 2) ,(1, 1919293200, 3) ,(1, 1932598800, 2) ,(1, 1950742800, 3) ,(1, 1964048400, 2) ,(1, 1982797200, 3) ,(1, 1995498000, 2) ,(1, 2014246800, 3) ,(1, 2026947600, 2) ,(1, 2045696400, 3) ,(1, 2058397200, 2) ,(1, 2077146000, 3) ,(1, 2090451600, 2) ,(1, 2108595600, 3) ,(1, 2121901200, 2) ,(1, 2140045200, 3) ,(3, -1688265000, 2) ,(3, -1656819048, 1) ,(3, -1641353448, 2) ,(3, -1627965048, 3) ,(3, -1618716648, 1) ,(3, -1596429048, 3) ,(3, -1593829848, 5) ,(3, -1589860800, 4) ,(3, -1542427200, 5) ,(3, -1539493200, 6) ,(3, -1525323600, 5) ,(3, -1522728000, 4) ,(3, -1491188400, 7) ,(3, -1247536800, 4) ,(3, 354920400, 5) ,(3, 370728000, 4) ,(3, 386456400, 5) ,(3, 402264000, 4) ,(3, 417992400, 5) ,(3, 433800000, 4) ,(3, 449614800, 5) ,(3, 465346800, 8) ,(3, 481071600, 9) ,(3, 496796400, 8) ,(3, 512521200, 9) ,(3, 528246000, 8) ,(3, 543970800, 9) ,(3, 559695600, 8) ,(3, 575420400, 9) ,(3, 591145200, 8) ,(3, 606870000, 9) ,(3, 622594800, 8) ,(3, 638319600, 9) ,(3, 654649200, 8) ,(3, 670374000, 10) ,(3, 686102400, 11) ,(3, 695779200, 8) ,(3, 701812800, 5) ,(3, 717534000, 4) ,(3, 733273200, 9) ,(3, 748998000, 8) ,(3, 764722800, 9) ,(3, 780447600, 8) ,(3, 796172400, 9) ,(3, 811897200, 8) ,(3, 828226800, 9) ,(3, 846370800, 8) ,(3, 859676400, 9) ,(3, 877820400, 8) ,(3, 891126000, 9) ,(3, 909270000, 8) ,(3, 922575600, 9) ,(3, 941324400, 8) ,(3, 954025200, 9) ,(3, 972774000, 8) ,(3, 985474800, 9) ,(3, 1004223600, 8) ,(3, 1017529200, 9) ,(3, 1035673200, 8) ,(3, 1048978800, 9) ,(3, 1067122800, 8) ,(3, 1080428400, 9) ,(3, 1099177200, 8) ,(3, 1111878000, 9) ,(3, 1130626800, 8) ,(3, 1143327600, 9) ,(3, 1162076400, 8) ,(3, 1174777200, 9) ,(3, 1193526000, 8) ,(3, 1206831600, 9) ,(3, 1224975600, 8) ,(3, 1238281200, 9) ,(3, 1256425200, 8) ,(3, 1269730800, 9) ,(3, 1288479600, 8) ,(3, 1301180400, 9) ,(3, 1319929200, 8) ,(3, 1332630000, 9) ,(3, 1351378800, 8) ,(3, 1364684400, 9) ,(3, 1382828400, 8) ,(3, 1396134000, 9) ,(3, 1414278000, 8) ,(3, 1427583600, 9) ,(3, 1445727600, 8) ,(3, 1459033200, 9) ,(3, 1477782000, 8) ,(3, 1490482800, 9) ,(3, 1509231600, 8) ,(3, 1521932400, 9) ,(3, 1540681200, 8) ,(3, 1553986800, 9) ,(3, 1572130800, 8) ,(3, 1585436400, 9) ,(3, 1603580400, 8) ,(3, 1616886000, 9) ,(3, 1635634800, 8) ,(3, 1648335600, 9) ,(3, 1667084400, 8) ,(3, 1679785200, 9) ,(3, 1698534000, 8) ,(3, 1711839600, 9) ,(3, 1729983600, 8) ,(3, 1743289200, 9) ,(3, 1761433200, 8) ,(3, 1774738800, 9) ,(3, 1792882800, 8) ,(3, 1806188400, 9) ,(3, 1824937200, 8) ,(3, 1837638000, 9) ,(3, 1856386800, 8) ,(3, 1869087600, 9) ,(3, 1887836400, 8) ,(3, 1901142000, 9) ,(3, 1919286000, 8) ,(3, 1932591600, 9) ,(3, 1950735600, 8) ,(3, 1964041200, 9) ,(3, 1982790000, 8) ,(3, 1995490800, 9) ,(3, 2014239600, 8) ,(3, 2026940400, 9) ,(3, 2045689200, 8) ,(3, 2058390000, 9) ,(3, 2077138800, 8) ,(3, 2090444400, 9) ,(3, 2108588400, 8) ,(3, 2121894000, 9) ,(3, 2140038000, 8) ,(4, -1688265000, 2) ,(4, -1656819048, 1) ,(4, -1641353448, 2) ,(4, -1627965048, 3) ,(4, -1618716648, 1) ,(4, -1596429048, 3) ,(4, -1593829848, 5) ,(4, -1589860800, 4) ,(4, -1542427200, 5) ,(4, -1539493200, 6) ,(4, -1525323600, 5) ,(4, -1522728000, 4) ,(4, -1491188400, 7) ,(4, -1247536800, 4) ,(4, 354920409, 5) ,(4, 370728010, 4) ,(4, 386456410, 5) ,(4, 402264011, 4) ,(4, 417992411, 5) ,(4, 433800012, 4) ,(4, 449614812, 5) ,(4, 465346812, 8) ,(4, 481071612, 9) ,(4, 496796413, 8) ,(4, 512521213, 9) ,(4, 528246013, 8) ,(4, 543970813, 9) ,(4, 559695613, 8) ,(4, 575420414, 9) ,(4, 591145214, 8) ,(4, 606870014, 9) ,(4, 622594814, 8) ,(4, 638319615, 9) ,(4, 654649215, 8) ,(4, 670374016, 10) ,(4, 686102416, 11) ,(4, 695779216, 8) ,(4, 701812816, 5) ,(4, 717534017, 4) ,(4, 733273217, 9) ,(4, 748998018, 8) ,(4, 764722818, 9) ,(4, 780447619, 8) ,(4, 796172419, 9) ,(4, 811897219, 8) ,(4, 828226820, 9) ,(4, 846370820, 8) ,(4, 859676420, 9) ,(4, 877820421, 8) ,(4, 891126021, 9) ,(4, 909270021, 8) ,(4, 922575622, 9) ,(4, 941324422, 8) ,(4, 954025222, 9) ,(4, 972774022, 8) ,(4, 985474822, 9) ,(4, 1004223622, 8) ,(4, 1017529222, 9) ,(4, 1035673222, 8) ,(4, 1048978822, 9) ,(4, 1067122822, 8) ,(4, 1080428422, 9) ,(4, 1099177222, 8) ,(4, 1111878022, 9) ,(4, 1130626822, 8) ,(4, 1143327622, 9) ,(4, 1162076422, 8) ,(4, 1174777222, 9) ,(4, 1193526022, 8) ,(4, 1206831622, 9) ,(4, 1224975622, 8) ,(4, 1238281222, 9) ,(4, 1256425222, 8) ,(4, 1269730822, 9) ,(4, 1288479622, 8) ,(4, 1301180422, 9) ,(4, 1319929222, 8) ,(4, 1332630022, 9) ,(4, 1351378822, 8) ,(4, 1364684422, 9) ,(4, 1382828422, 8) ,(4, 1396134022, 9) ,(4, 1414278022, 8) ,(4, 1427583622, 9) ,(4, 1445727622, 8) ,(4, 1459033222, 9) ,(4, 1477782022, 8) ,(4, 1490482822, 9) ,(4, 1509231622, 8) ,(4, 1521932422, 9) ,(4, 1540681222, 8) ,(4, 1553986822, 9) ,(4, 1572130822, 8) ,(4, 1585436422, 9) ,(4, 1603580422, 8) ,(4, 1616886022, 9) ,(4, 1635634822, 8) ,(4, 1648335622, 9) ,(4, 1667084422, 8) ,(4, 1679785222, 9) ,(4, 1698534022, 8) ,(4, 1711839622, 9) ,(4, 1729983622, 8) ,(4, 1743289222, 9) ,(4, 1761433222, 8) ,(4, 1774738822, 9) ,(4, 1792882822, 8) ,(4, 1806188422, 9) ,(4, 1824937222, 8) ,(4, 1837638022, 9) ,(4, 1856386822, 8) ,(4, 1869087622, 9) ,(4, 1887836422, 8) ,(4, 1901142022, 9) ,(4, 1919286022, 8) ,(4, 1932591622, 9) ,(4, 1950735622, 8) ,(4, 1964041222, 9) ,(4, 1982790022, 8) ,(4, 1995490822, 9) ,(4, 2014239622, 8) ,(4, 2026940422, 9) ,(4, 2045689222, 8) ,(4, 2058390022, 9) ,(4, 2077138822, 8) ,(4, 2090444422, 9) ,(4, 2108588422, 8) ,(4, 2121894022, 9) ,(4, 2140038022, 8); + +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; +INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET'),(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET'),(2, 0, 0, 0, 'UTC'),(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST'),(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST'),(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD'),(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET'),(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD'),(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET'),(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST'),(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST'),(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD'),(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET'),(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD'),(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET'); +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; +INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3),(157766403, 4) ,(189302404, 5) ,(220924805, 6),(252460806, 7) ,(283996807, 8) ,(315532808, 9),(362793609, 10) ,(394329610, 11) ,(425865611, 12),(489024012, 13) ,(567993613, 14) ,(631152014, 15),(662688015, 16) ,(709948816, 17) ,(741484817, 18),(773020818, 19) ,(820454419, 20) ,(867715220, 21),(915148821, 22); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index a9a8764c941..bf1be6f5d7e 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -97,7 +97,7 @@ long innobase_mirrored_log_groups, innobase_log_files_in_group, innobase_buffer_pool_size, innobase_additional_mem_pool_size, innobase_file_io_threads, innobase_lock_wait_timeout, innobase_thread_concurrency, innobase_force_recovery, - innobase_open_files; + innobase_open_files, innobase_auto_extend_increment; /* The default values for the following char* start-up parameters are determined in innobase_init below: */ @@ -963,6 +963,7 @@ innobase_init(void) srv_locks_unsafe_for_binlog = (ibool) innobase_locks_unsafe_for_binlog; srv_max_n_open_files = (ulint) innobase_open_files; + srv_auto_extend_increment = (ulint) innobase_auto_extend_increment; srv_innodb_status = (ibool) innobase_create_status_file; srv_print_verbose_log = mysql_embedded ? 0 : 1; diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index fa6c8a90d21..0ef5f3ddffe 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -183,6 +183,7 @@ extern long innobase_buffer_pool_awe_mem_mb; extern long innobase_file_io_threads, innobase_lock_wait_timeout; extern long innobase_force_recovery, innobase_thread_concurrency; extern long innobase_open_files; +extern long innobase_auto_extend_increment; extern char *innobase_data_home_dir, *innobase_data_file_path; extern char *innobase_log_group_home_dir, *innobase_log_arch_dir; extern char *innobase_unix_file_flush_method; diff --git a/sql/item.cc b/sql/item.cc index 1e090333bf4..8233d050783 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1271,11 +1271,10 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING - or SELECT list or outer SELECT do not use groupping (i.e. tables - are accessable) + or outer SELECT do not use groupping (i.e. tables are + accessable) */ - if (((place != IN_HAVING && - place != SELECT_LIST) || + if ((place != IN_HAVING || (sl->with_sum_func == 0 && sl->group_list.elements == 0)) && (tmp= find_field_in_tables(thd, this, table_list, &where, @@ -1954,8 +1953,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) or SELECT list or outer SELECT do not use groupping (i.e. tables are accessable) */ - if (((place != IN_HAVING && - place != SELECT_LIST) || + if ((place != IN_HAVING || (sl->with_sum_func == 0 && sl->group_list.elements == 0)) && (tmp= find_field_in_tables(thd, this, table_list, &where, diff --git a/sql/item.h b/sql/item.h index 23c5c844f21..7a1e7c5d0d2 100644 --- a/sql/item.h +++ b/sql/item.h @@ -706,8 +706,8 @@ public: class Item_empty_string :public Item_string { public: - Item_empty_string(const char *header,uint length) :Item_string("",0, - &my_charset_bin) + Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : + Item_string("",0, cs ? cs : &my_charset_bin) { name=(char*) header; max_length=length;} void make_field(Send_field *field); }; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 8d140efac5f..3ddf9a1c6bf 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -934,9 +934,6 @@ Item_in_subselect::row_value_transformer(JOIN *join) } select_lex->uncacheable|= UNCACHEABLE_DEPENDENT; - select_lex->setup_ref_array(thd, - select_lex->order_list.elements + - select_lex->group_list.elements); { uint n= left_expr->cols(); List_iterator_fast li(select_lex->item_list); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index ce64d2a39da..30722d56b2a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4005,6 +4005,7 @@ enum options_mysqld OPT_INNODB_STATUS_FILE, OPT_INNODB_MAX_DIRTY_PAGES_PCT, OPT_INNODB_OPEN_FILES, + OPT_INNODB_AUTOEXTEND_INCREMENT, OPT_BDB_CACHE_SIZE, OPT_BDB_LOG_BUFFER_SIZE, OPT_BDB_MAX_LOCK, @@ -4752,6 +4753,11 @@ replicating a LOAD DATA INFILE command.", "How many files at the maximum InnoDB keeps open at the same time.", (gptr*) &innobase_open_files, (gptr*) &innobase_open_files, 0, GET_LONG, REQUIRED_ARG, 300L, 10L, ~0L, 0, 1L, 0}, + {"innodb_autoextend_increment", OPT_INNODB_AUTOEXTEND_INCREMENT, + "Data file autoextend increment in megabytes", + (gptr*) &innobase_auto_extend_increment, + (gptr*) &innobase_auto_extend_increment, + 0, GET_LONG, REQUIRED_ARG, 8L, 1L, ~0L, 0, 1L, 0}, #ifdef HAVE_REPLICATION /* Disabled for the 4.1.3 release. Disabling just this paragraph of code is diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 30f97cf20a9..75eb5753e1e 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2142,8 +2142,12 @@ find_item_in_list(Item *find, List &items, uint *counter, case sensitive. In cases where they are not case sensitive, they are always in lower case. + + item_field->field_name and item_field->table_name can be 0x0 if + item is not fix fielded yet. */ - if (!my_strcasecmp(system_charset_info, item_field->field_name, + if (item_field->field_name && item_field->table_name && + !my_strcasecmp(system_charset_info, item_field->field_name, field_name) && !strcmp(item_field->table_name, table_name) && (!db_name || (item_field->db_name && diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 235558a759d..674452192f8 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1532,11 +1532,11 @@ ulong Query_cache::init_cache() query_cache_table_get_key, 0, 0)); #else /* - On windows, OS/2, MacOS X with HFS+ or any other case insensitive - file system if lower_case_table_names!=0 we have same situation as - in previous case, but if lower_case_table_names==0 then we should - not distinguish cases (to be compatible in behavior with underlaying - file system) and so should use case insensitive collation for + On windows, OS/2, MacOS X with HFS+ or any other case insensitive + file system if lower_case_table_names!=0 we have same situation as + in previous case, but if lower_case_table_names==0 then we should + not distinguish cases (to be compatible in behavior with underlying + file system) and so should use case insensitive collation for comparison. */ VOID(hash_init(&tables, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 349fc792a2a..16c0c206df3 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -654,27 +654,29 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length) return new_table; } + int THD::send_explain_fields(select_result *result) { List field_list; Item *item; + CHARSET_INFO *cs= system_charset_info; field_list.push_back(new Item_return_int("id",3, MYSQL_TYPE_LONGLONG)); - field_list.push_back(new Item_empty_string("select_type",19)); - field_list.push_back(new Item_empty_string("table",NAME_LEN)); - field_list.push_back(new Item_empty_string("type",10)); + field_list.push_back(new Item_empty_string("select_type", 19, cs)); + field_list.push_back(new Item_empty_string("table", NAME_LEN, cs)); + field_list.push_back(new Item_empty_string("type", 10, cs)); field_list.push_back(item=new Item_empty_string("possible_keys", - NAME_LEN*MAX_KEY)); + NAME_LEN*MAX_KEY, cs)); item->maybe_null=1; - field_list.push_back(item=new Item_empty_string("key",NAME_LEN)); + field_list.push_back(item=new Item_empty_string("key", NAME_LEN, cs)); item->maybe_null=1; field_list.push_back(item=new Item_return_int("key_len",3, MYSQL_TYPE_LONGLONG)); item->maybe_null=1; field_list.push_back(item=new Item_empty_string("ref", - NAME_LEN*MAX_REF_PARTS)); + NAME_LEN*MAX_REF_PARTS, cs)); item->maybe_null=1; - field_list.push_back(new Item_return_int("rows",10, MYSQL_TYPE_LONGLONG)); - field_list.push_back(new Item_empty_string("Extra",255)); + field_list.push_back(new Item_return_int("rows", 10, MYSQL_TYPE_LONGLONG)); + field_list.push_back(new Item_empty_string("Extra", 255, cs)); return (result->send_fields(field_list,1)); } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 2fa169ce999..3deecccb4e1 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1550,6 +1550,7 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num) 1 - found 0 - OK (table did not found) */ + bool st_select_lex_unit::check_updateable(char *db, char *table) { for (SELECT_LEX *sl= first_select(); sl; sl= sl->next_select()) @@ -1560,8 +1561,8 @@ bool st_select_lex_unit::check_updateable(char *db, char *table) /* - Find db.table which will be updated in this select and - underlayed ones (except derived tables) + Find db.table which will be updated in this select and + underlying ones (except derived tables) SYNOPSIS st_select_lex::check_updateable() @@ -1572,11 +1573,30 @@ bool st_select_lex_unit::check_updateable(char *db, char *table) 1 - found 0 - OK (table did not found) */ + bool st_select_lex::check_updateable(char *db, char *table) { if (find_real_table_in_list(get_table_list(), db, table)) return 1; + return check_updateable_in_subqueries(db, table); +} + +/* + Find db.table which will be updated in underlying subqueries + + SYNOPSIS + st_select_lex::check_updateable_in_subqueries() + db - data base name + table - real table name + + RETURN + 1 - found + 0 - OK (table did not found) +*/ + +bool st_select_lex::check_updateable_in_subqueries(char *db, char *table) +{ for (SELECT_LEX_UNIT *un= first_inner_unit(); un; un= un->next_unit()) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 7342902c086..dffe7bcb2b0 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -517,6 +517,7 @@ public: } bool setup_ref_array(THD *thd, uint order_group_num); bool check_updateable(char *db, char *table); + bool check_updateable_in_subqueries(char *db, char *table); void print(THD *thd, String *str); static void print_order(String *str, ORDER *order); void print_limit(THD *thd, String *str); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 75c1e0b859e..2c5ec34b867 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2796,24 +2796,19 @@ unsent_create_error: target_tbl; target_tbl= target_tbl->next) { - target_tbl->table= target_tbl->table_list->table; - /* + TABLE_LIST *orig= target_tbl->table_list; + target_tbl->table= orig->table; + /* Multi-delete can't be constructed over-union => we always have - single SELECT on top and have to check underlaying SELECTs of it + single SELECT on top and have to check underlying SELECTs of it */ - for (SELECT_LEX_UNIT *un= lex->select_lex.first_inner_unit(); - un; - un= un->next_unit()) + if (lex->select_lex.check_updateable_in_subqueries(orig->db, + orig->real_name)) { - if (un->first_select()->linkage != DERIVED_TABLE_TYPE && - un->check_updateable(target_tbl->table_list->db, - target_tbl->table_list->real_name)) - { - my_error(ER_UPDATE_TABLE_USED, MYF(0), - target_tbl->table_list->real_name); - res= -1; - break; - } + my_error(ER_UPDATE_TABLE_USED, MYF(0), + orig->real_name); + res= -1; + break; } } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 6e8cc843d1a..e8e111a9a37 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8465,6 +8465,8 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, } } else if ((pos->type() == Item::FUNC_ITEM || + pos->type() == Item::SUBSELECT_ITEM || + pos->type() == Item::CACHE_ITEM || pos->type() == Item::COND_ITEM) && !pos->with_sum_func) { // Save for send fields diff --git a/sql/sql_update.cc b/sql/sql_update.cc index db4edff4fa1..b6cd0d967e9 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -490,9 +490,8 @@ int mysql_multi_update(THD *thd, table->grant.want_privilege= (UPDATE_ACL & ~table->grant.privilege); } - if (thd->lex->derived_tables) + /* Assign table map values to check updatability of derived tables */ { - // Assign table map values to check updatability of derived tables uint tablenr=0; for (TABLE_LIST *table_list= update_list; table_list; @@ -501,11 +500,12 @@ int mysql_multi_update(THD *thd, table_list->table->map= (table_map) 1 << tablenr; } } + if (setup_fields(thd, 0, update_list, *fields, 1, 0, 0)) DBUG_RETURN(-1); - if (thd->lex->derived_tables) + + /* Find tables used in items */ { - // Find tables used in items List_iterator_fast it(*fields); Item *item; while ((item= it++)) @@ -527,7 +527,23 @@ int mysql_multi_update(THD *thd, if (table->timestamp_field && table->timestamp_field->query_id == thd->query_id) table->timestamp_on_update_now= 0; - + + /* if table will be updated then check that it is unique */ + if (table->map & item_tables) + { + /* + Multi-update can't be constructed over-union => we always have + single SELECT on top and have to check underlaying SELECTs of it + */ + if (select_lex->check_updateable_in_subqueries(tl->db, + tl->real_name)) + { + my_error(ER_UPDATE_TABLE_USED, MYF(0), + tl->real_name); + DBUG_RETURN(-1); + } + } + if (tl->derived) derived_tables|= table->map; } diff --git a/sql/tztime.cc b/sql/tztime.cc index af9af530fec..08e6fc7026e 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1636,8 +1636,8 @@ end_with_setting_default_tz: /* If we have default time zone try to load it */ if (default_tzname) { - String tzname(default_tzname, &my_charset_latin1); - if (!(global_system_variables.time_zone= my_tz_find(&tzname, tables))) + String tmp_tzname(default_tzname, &my_charset_latin1); + if (!(global_system_variables.time_zone= my_tz_find(&tmp_tzname, tables))) { sql_print_error("Fatal error: Illegal or unknown default time zone '%s'", default_tzname);