Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
This commit is contained in:
commit
ca65afeb72
11
acinclude.m4
11
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],
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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 <derived6> 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 <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
|
@ -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 <derived6> 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 <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
|
@ -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 <derived6> 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 <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
|
@ -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 <derived6> 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 <derived6> 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 <derived6> 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 <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
|
@ -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 <derived6> 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 <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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;
|
||||
|
@ -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;
|
||||
|
10
sql/item.cc
10
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,
|
||||
|
@ -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);
|
||||
};
|
||||
|
@ -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<Item> li(select_lex->item_list);
|
||||
|
@ -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
|
||||
|
@ -2142,8 +2142,12 @@ find_item_in_list(Item *find, List<Item> &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 &&
|
||||
|
@ -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,
|
||||
|
@ -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<Item> 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));
|
||||
}
|
||||
|
||||
|
@ -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())
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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<Item> 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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user