summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBUILD/check-cpu6
-rw-r--r--client/mysqltest.c3
-rw-r--r--include/config-netware.h4
-rw-r--r--mysql-test/r/compare.result7
-rw-r--r--mysql-test/r/group_by.result9
-rw-r--r--mysql-test/r/index_merge_innodb.result40
-rw-r--r--mysql-test/r/innodb_mysql.result40
-rw-r--r--mysql-test/r/join_outer.result2
-rw-r--r--mysql-test/r/ndb_condition_pushdown.result6
-rw-r--r--mysql-test/r/ndb_partition_key.result2
-rw-r--r--mysql-test/r/openssl_1.result9
-rw-r--r--mysql-test/r/order_by.result37
-rw-r--r--mysql-test/r/partition.result91
-rw-r--r--mysql-test/r/partition_mgm.result10
-rw-r--r--mysql-test/r/partition_range.result10
-rw-r--r--mysql-test/r/range.result58
-rw-r--r--mysql-test/r/select.result42
-rw-r--r--mysql-test/r/subselect.result22
-rw-r--r--mysql-test/r/type_datetime.result11
-rw-r--r--mysql-test/r/user_var.result9
-rw-r--r--mysql-test/r/view.result29
-rw-r--r--mysql-test/t/compare.test9
-rw-r--r--mysql-test/t/disabled.def5
-rw-r--r--mysql-test/t/group_by.test12
-rw-r--r--mysql-test/t/index_merge_innodb.test27
-rw-r--r--mysql-test/t/innodb_mysql.test47
-rw-r--r--mysql-test/t/join_outer.test1
-rw-r--r--mysql-test/t/openssl_1.test10
-rw-r--r--mysql-test/t/order_by.test32
-rw-r--r--mysql-test/t/partition.test99
-rw-r--r--mysql-test/t/partition_mgm.test17
-rw-r--r--mysql-test/t/partition_mgm_err2.test5
-rw-r--r--mysql-test/t/partition_range.test13
-rw-r--r--mysql-test/t/range.test55
-rw-r--r--mysql-test/t/select.test41
-rw-r--r--mysql-test/t/subselect.test25
-rw-r--r--mysql-test/t/type_datetime.test11
-rw-r--r--mysql-test/t/user_var.test10
-rw-r--r--mysql-test/t/view.test42
-rw-r--r--sql/ha_innodb.cc31
-rw-r--r--sql/ha_partition.cc102
-rw-r--r--sql/ha_partition.h11
-rw-r--r--sql/handler.h2
-rw-r--r--sql/item.cc20
-rw-r--r--sql/item.h2
-rw-r--r--sql/item_cmpfunc.cc54
-rw-r--r--sql/item_func.cc55
-rw-r--r--sql/item_func.h7
-rw-r--r--sql/item_subselect.cc47
-rw-r--r--sql/item_timefunc.cc2
-rw-r--r--sql/mysql_priv.h10
-rw-r--r--sql/opt_range.cc364
-rw-r--r--sql/set_var.cc2
-rw-r--r--sql/share/errmsg.txt6
-rw-r--r--sql/sql_acl.cc9
-rw-r--r--sql/sql_base.cc6
-rw-r--r--sql/sql_class.cc2
-rw-r--r--sql/sql_delete.cc4
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_load.cc1
-rw-r--r--sql/sql_locale.cc327
-rw-r--r--sql/sql_parse.cc15
-rw-r--r--sql/sql_partition.cc61
-rw-r--r--sql/sql_select.cc111
-rw-r--r--sql/sql_show.cc2
-rw-r--r--sql/sql_update.cc4
-rw-r--r--sql/sql_yacc.yy49
-rw-r--r--sql/table.cc25
-rw-r--r--storage/innobase/btr/btr0btr.c2
-rw-r--r--storage/innobase/buf/buf0buf.c5
-rw-r--r--storage/innobase/dict/dict0dict.c11
-rw-r--r--storage/innobase/fil/fil0fil.c9
-rw-r--r--storage/innobase/fsp/fsp0fsp.c2
-rw-r--r--storage/innobase/include/btr0cur.ic5
-rw-r--r--storage/innobase/include/buf0buf.ic8
-rw-r--r--storage/innobase/log/log0log.c2
-rw-r--r--storage/innobase/log/log0recv.c4
-rw-r--r--storage/innobase/os/os0file.c12
-rw-r--r--storage/innobase/row/row0mysql.c27
-rw-r--r--storage/innobase/row/row0sel.c2
-rw-r--r--storage/innobase/srv/srv0start.c2
-rw-r--r--storage/innobase/ut/ut0dbg.c2
-rw-r--r--tests/mysql_client_test.c6
83 files changed, 1697 insertions, 643 deletions
diff --git a/BUILD/check-cpu b/BUILD/check-cpu
index 583e31ee389..2543b540d2a 100755
--- a/BUILD/check-cpu
+++ b/BUILD/check-cpu
@@ -93,6 +93,10 @@ case "$cpu_family--$model_name" in
*Opteron*)
cpu_arg="opteron";
;;
+ # MacOSX / Intel
+ *i386*i486*)
+ cpu_arg="pentium-m";
+ ;;
# Intel ia64
*Itanium*)
@@ -131,7 +135,7 @@ else
fi
cc_ver=`$cc --version | sed 1q`
-cc_verno=`echo $cc_ver | sed -e 's/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
+cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
case "$cc_ver--$cc_verno" in
*GCC*)
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 06f6ab2f1ce..fdd00ba4af2 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -5527,9 +5527,6 @@ int main(int argc, char **argv)
if ( opt_mark_progress )
dump_progress(result_file);
dynstr_free(&ds_progress);
-
- dynstr_free(&ds_res);
-
if (!got_end_timer)
timer_output(); /* No end_timer cmd, end it */
free_used_memory();
diff --git a/include/config-netware.h b/include/config-netware.h
index e2fc75ab90d..c30fc099985 100644
--- a/include/config-netware.h
+++ b/include/config-netware.h
@@ -122,6 +122,10 @@ extern "C" {
/* On NetWare, to fix the problem with the deletion of open files */
#define CANT_DELETE_OPEN_FILES 1
+#define FN_LIBCHAR '\\'
+#define FN_ROOTDIR "\\"
+#define FN_DEVCHAR ':'
+
/* default directory information */
#define DEFAULT_MYSQL_HOME "sys:/mysql"
#define PACKAGE "mysql"
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index 6f667aabac0..da0ca8ddba1 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -42,3 +42,10 @@ CHAR(31) = '' '' = CHAR(31)
SELECT CHAR(30) = '', '' = CHAR(30);
CHAR(30) = '' '' = CHAR(30)
0 0
+create table t1 (a tinyint(1),b binary(1));
+insert into t1 values (0x01,0x01);
+select * from t1 where a=b;
+a b
+select * from t1 where a=b and b=0x01;
+a b
+drop table if exists t1;
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 00f675db075..709d60b963f 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -821,3 +821,12 @@ a b real_b
68 France France
DROP VIEW v1;
DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
+EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 5 NULL 4
+EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
+DROP TABLE t1;
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index ae25cc28101..5af3e291c87 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -282,3 +282,43 @@ kp1='279' AND kp2='ELM0678' AND kp3='6' AND kp4='10' AND kp5 = 'R ';
COUNT(*)
1
drop table t1;
+create table t1
+(
+key1 int not null,
+key2 int not null default 0,
+key3 int not null default 0
+);
+insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
+set @d=8;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+insert into t1 (key1) select key1+@d from t1;
+set @d=@d*2;
+alter table t1 add index i2(key2);
+alter table t1 add index i3(key3);
+update t1 set key2=key1,key3=key1;
+explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 11 Using sort_union(i3,i2); Using where
+select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
+key1 key2 key3
+31 31 31
+32 32 32
+33 33 33
+34 34 34
+35 35 35
+36 36 36
+37 37 37
+38 38 38
+39 39 39
+drop table t1;
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 9f177e99a17..b1336b35f1e 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -89,6 +89,27 @@ b a
3 3
3 3
DROP TABLE t1, t2, t3;
+CREATE TABLE `t1` (`id1` INT) ;
+INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
+CREATE TABLE `t2` (
+`id1` INT,
+`id2` INT NOT NULL,
+`id3` INT,
+`id4` INT NOT NULL,
+UNIQUE (`id2`,`id4`),
+KEY (`id1`)
+) ENGINE=InnoDB;
+INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
+(1,1,1,0),
+(1,1,2,1),
+(5,1,2,2),
+(6,1,2,3),
+(1,2,2,2),
+(1,2,1,1);
+SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2);
+id1
+2
+DROP TABLE t1, t2;
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
@@ -303,6 +324,25 @@ explain select distinct f1, f2 from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
drop table t1;
+CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
+INDEX (name)) ENGINE=InnoDB;
+CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
+FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
+INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+WHERE t1.name LIKE 'A%';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
+1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+WHERE t1.name LIKE 'A%' OR FALSE;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
+DROP TABLE t1,t2;
set storage_engine=innodb;
CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2);
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index aca47a675d4..0a309371725 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -737,7 +737,7 @@ explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
order by m.match_id desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE s ALL NULL NULL NULL NULL 10
+1 SIMPLE s ALL NULL NULL NULL NULL 10 Using temporary; Using filesort
1 SIMPLE m const match_id,match_id_2 match_id 1 const 1
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
(t2 s left join t1 m on m.match_id = 1)
diff --git a/mysql-test/r/ndb_condition_pushdown.result b/mysql-test/r/ndb_condition_pushdown.result
index 2fc1e8f3127..a484cbfe608 100644
--- a/mysql-test/r/ndb_condition_pushdown.result
+++ b/mysql-test/r/ndb_condition_pushdown.result
@@ -1307,7 +1307,7 @@ select auto from t1 where
('1901-01-01 01:01:01' between date_time and date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
+1 SIMPLE t1 range medium_index medium_index 3 NULL 1 Using where with pushed condition; Using filesort
select auto from t1 where
("aaaa" between string and string) and
("aaaa" between vstring and vstring) and
@@ -1409,7 +1409,7 @@ select auto from t1 where
('1901-01-01 01:01:01' not between date_time and date_time)
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
+1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
select auto from t1 where
("aaaa" not between string and string) and
("aaaa" not between vstring and vstring) and
@@ -1565,7 +1565,7 @@ time_field not in('01:01:01','03:03:03') and
date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
order by auto;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range medium_index medium_index 3 NULL 2 Using where with pushed condition; Using filesort
+1 SIMPLE t1 range medium_index medium_index 3 NULL 6 Using where with pushed condition; Using filesort
select auto from t1 where
string not in("aaaa","cccc") and
vstring not in("aaaa","cccc") and
diff --git a/mysql-test/r/ndb_partition_key.result b/mysql-test/r/ndb_partition_key.result
index e478c23ec00..7e480f68dd9 100644
--- a/mysql-test/r/ndb_partition_key.result
+++ b/mysql-test/r/ndb_partition_key.result
@@ -17,7 +17,7 @@ drop table t1;
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
ENGINE = NDB
PARTITION BY KEY (c);
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
+ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
ENGINE = NDB
PARTITION BY KEY (a);
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 1fcfb11525e..8f9fd50eced 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -3,9 +3,12 @@ create table t1(f1 int);
insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
-grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com";
-grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
+connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET);
+ERROR 28000: Access denied for user 'ssl_user5'@'localhost' (using password: NO)
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -39,7 +42,7 @@ f1
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1'
drop user ssl_user1@localhost, ssl_user2@localhost,
-ssl_user3@localhost, ssl_user4@localhost;
+ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1;
mysqltest: Could not open connection 'default': 2026 SSL connection error
mysqltest: Could not open connection 'default': 2026 SSL connection error
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 9756ab49ac7..64653de5e9c 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -854,3 +854,40 @@ b a
20 1
10 2
DROP TABLE t1;
+CREATE TABLE t1 (a int, b int, PRIMARY KEY (a));
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+explain SELECT t1.b as a, t2.b as c FROM
+t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
+ORDER BY c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
+1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
+SELECT t2.b as c FROM
+t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
+ORDER BY c;
+c
+NULL
+NULL
+2
+explain SELECT t1.b as a, t2.b as c FROM
+t1 JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
+ORDER BY c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * from t1;
+CREATE TABLE t3 LIKE t1;
+INSERT INTO t3 SELECT * from t1;
+CREATE TABLE t4 LIKE t1;
+INSERT INTO t4 SELECT * from t1;
+INSERT INTO t1 values (0,0),(4,4);
+SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
+ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;
+b
+NULL
+NULL
+1
+2
+3
+DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index e95489864f7..2e2af07bfdc 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -1,4 +1,60 @@
drop table if exists t1;
+create table t1 (s1 char(2) character set utf8)
+partition by list (case when s1 > 'cz' then 1 else 2 end)
+(partition p1 values in (1),
+partition p2 values in (2));
+drop table t1;
+create table t1 (a int)
+partition by key(a)
+partitions 0.2+e1;
+ERROR 42000: Only normal integers allowed as number here near '0.2+e1' at line 3
+create table t1 (a int)
+partition by key(a)
+partitions -1;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 3
+create table t1 (a int)
+partition by key(a)
+partitions 1.5;
+ERROR 42000: Only normal integers allowed as number here near '1.5' at line 3
+create table t1 (a int)
+partition by key(a)
+partitions 1e+300;
+ERROR 42000: Only normal integers allowed as number here near '1e+300' at line 3
+create table t1 (a int)
+engine = innodb
+partition by key (a);
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 InnoDB 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+insert into t1 values (0), (1), (2), (3);
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 InnoDB 10 Compact 4 4096 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
+drop table t1;
+create table t1 (a int auto_increment primary key)
+engine = innodb
+partition by key (a);
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 InnoDB 10 Compact 2 8192 16384 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL partitioned
+insert into t1 values (NULL), (NULL), (NULL), (NULL);
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 InnoDB 10 Compact 4 4096 16384 0 0 0 5 NULL NULL NULL latin1_swedish_ci NULL partitioned
+insert into t1 values (NULL), (NULL), (NULL), (NULL);
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 InnoDB 10 Compact 8 2048 16384 0 0 0 9 NULL NULL NULL latin1_swedish_ci NULL partitioned
+drop table t1;
+create table t1 (a int)
+partition by key (a)
+(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+ERROR 42000: Incorrect table name 'part-data'
+create table t1 (a int)
+partition by key (a)
+(partition p0,
+partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+ERROR 42000: Incorrect table name 'part-data'
create table t1 (a int)
partition by list (a)
(partition p0 values in (1));
@@ -731,7 +787,7 @@ ERROR HY000: Cannot create temporary table with partitions
create table t1 (a int, b int) partition by list (a)
(partition p1 values in (1), partition p2 values in (2));
alter table t1 add primary key (b);
-ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
+ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -750,11 +806,6 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' /*!50100 PARTITION BY KEY (a) */
drop table t2;
-create table t1 (s1 char(2) character set utf8)
-partition by list (case when s1 > 'cz' then 1 else 2 end)
-(partition p1 values in (1),
-partition p2 values in (2));
-drop table t1;
create table t1 (f1 int) partition by hash (f1) as select 1;
drop table t1;
prepare stmt1 from 'create table t1 (s1 int) partition by hash (s1)';
@@ -1117,4 +1168,32 @@ hello/master-data/tmpinx/t1#P#p1#SP#subpart11.MYI
hello/master-data/tmpinx/t1#P#p2#SP#subpart20.MYI
hello/master-data/tmpinx/t1#P#p2#SP#subpart21.MYI
drop table t1;
+create table t1 (a bigint unsigned not null, primary key(a))
+engine = myisam
+partition by key (a)
+partitions 10;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` bigint(20) unsigned NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
+insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE),
+(18446744073709551613), (18446744073709551612);
+select * from t1;
+a
+18446744073709551612
+18446744073709551613
+18446744073709551614
+18446744073709551615
+select * from t1 where a = 18446744073709551615;
+a
+18446744073709551615
+delete from t1 where a = 18446744073709551615;
+select * from t1;
+a
+18446744073709551612
+18446744073709551613
+18446744073709551614
+drop table t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_mgm.result b/mysql-test/r/partition_mgm.result
index f64ffaff495..9b5a34bda50 100644
--- a/mysql-test/r/partition_mgm.result
+++ b/mysql-test/r/partition_mgm.result
@@ -1,4 +1,14 @@
DROP TABLE IF EXISTS t1;
+create table t1 (a int)
+partition by range (a)
+subpartition by key (a)
+(partition p0 values less than (10) (subpartition sp00, subpartition sp01),
+partition p1 values less than (20) (subpartition sp10, subpartition sp11));
+alter table t1 reorganize partition p0 into
+(partition p0 values less than (10) (subpartition sp00,
+subpartition sp01, subpartition sp02));
+ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting
+drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 9812c80040b..be88d9f6639 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,4 +1,14 @@
drop table if exists t1;
+create table t1 (a date)
+engine = innodb
+partition by range (year(a))
+(partition p0 values less than (2006),
+partition p1 values less than (2007));
+explain partitions select * from t1
+where a between '2006-01-01' and '2007-06-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
+drop table t1;
create table t1 (a int unsigned)
partition by range (a)
(partition pnull values less than (0),
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index a7e7d3aff2c..776a86ad2d5 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -838,3 +838,61 @@ select a, hex(filler) from t1 where a not between 'b' and 'b';
a hex(filler)
a 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
drop table t1,t2,t3;
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, key(a));
+insert into t2 select 2*(A.a + 10*(B.a + 10*C.a)) from t1 A, t1 B, t1 C;
+set @a="select * from t2 force index (a) where a NOT IN(0";
+select count(*) from (select @a:=concat(@a, ',', a) from t2 ) Z;
+count(*)
+1000
+set @a=concat(@a, ')');
+insert into t2 values (11),(13),(15);
+set @b= concat("explain ", @a);
+prepare stmt1 from @b;
+execute stmt1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index a a 5 NULL 1003 Using where; Using index
+prepare stmt1 from @a;
+execute stmt1;
+a
+11
+13
+15
+drop table t1, t2;
+CREATE TABLE t1 (
+id int NOT NULL DEFAULT '0',
+b int NOT NULL DEFAULT '0',
+c int NOT NULL DEFAULT '0',
+INDEX idx1(b,c), INDEX idx2(c));
+INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
+INSERT INTO t1(b,c) VALUES (3,4), (3,4);
+SELECT * FROM t1 WHERE b<=3 AND 3<=c;
+id b c
+0 3 4
+0 3 4
+SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
+id b c
+0 3 4
+0 3 4
+EXPLAIN SELECT * FROM t1 WHERE b<=3 AND 3<=c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx2 4 NULL 3 Using where
+EXPLAIN SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx2 4 NULL 3 Using where
+SELECT * FROM t1 WHERE 0 < b OR 0 > c;
+id b c
+0 3 4
+0 3 4
+SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
+id b c
+0 3 4
+0 3 4
+EXPLAIN SELECT * FROM t1 WHERE 0 < b OR 0 > c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
+EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
+DROP TABLE t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index f48ae16505b..85c36c8d41c 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2328,9 +2328,9 @@ explain select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found
+1 SIMPLE t4 const id4 NULL NULL NULL 1
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1
-1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where
select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
id1 id2 id3 id4 id44
@@ -3479,3 +3479,41 @@ Warning 1546 Leading spaces are removed from name ' a '
execute stmt;
a
1
+CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL);
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
+CREATE TABLE t2 (c int NOT NULL, INDEX idx(c));
+INSERT INTO t2 VALUES
+(1), (1), (1), (1), (1), (1), (1), (1),
+(2), (2), (2), (2),
+(3), (3),
+(4);
+EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 ref idx idx 4 const 7 Using index
+EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 ref idx idx 4 const 1 Using index
+DROP TABLE t1, t2;
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int);
+INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2);
+CREATE TABLE t2 (b int, c INT, INDEX idx1(b));
+INSERT INTO t2 VALUES (2,1), (3,2);
+CREATE TABLE t3 (d int, e int, INDEX idx1(d));
+INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50);
+EXPLAIN
+SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
+WHERE t1.id=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 const idx1 NULL NULL NULL 1
+1 SIMPLE t3 ref idx1 idx1 5 const 3 Using where
+SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
+WHERE t1.id=2;
+id a b c d e
+2 NULL NULL NULL 2 10
+2 NULL NULL NULL 2 20
+2 NULL NULL NULL 2 40
+2 NULL NULL NULL 2 50
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index bbad23446c6..141f9ed0f4a 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2915,6 +2915,28 @@ select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
s1
2
drop table t1;
+create table t1 (
+retailerID varchar(8) NOT NULL,
+statusID int(10) unsigned NOT NULL,
+changed datetime NOT NULL,
+UNIQUE KEY retailerID (retailerID, statusID, changed)
+);
+INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
+INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
+select * from t1 r1
+where (r1.retailerID,(r1.changed)) in
+(SELECT r2.retailerId,(max(changed)) from t1 r2
+group by r2.retailerId);
+retailerID statusID changed
+0026 2 2006-01-06 12:25:53
+0037 2 2006-01-06 12:25:53
+0048 1 2006-01-06 12:37:50
+0059 1 2006-01-06 12:37:50
+drop table t1;
create table t1 (df decimal(5,1));
insert into t1 values(1.1);
insert into t1 values(2.2);
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index ec3761a6a57..04b37f7ae86 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -168,3 +168,14 @@ dt
0000-00-00 00:00:00
0000-00-00 00:00:00
drop table t1;
+CREATE TABLE t1(a DATETIME NOT NULL);
+INSERT INTO t1 VALUES ('20060606155555');
+SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555");
+a
+2006-06-06 15:55:55
+PREPARE s FROM 'SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555")';
+EXECUTE s;
+a
+2006-06-06 15:55:55
+DROP PREPARE s;
+DROP TABLE t1;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index 1ff2e9948bd..53497fd528b 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -292,3 +292,12 @@ SELECT @a;
@a
18446744071710965857
drop table bigfailure;
+create table t1(f1 int, f2 int);
+insert into t1 values (1,2),(2,3),(3,1);
+select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
+@var:=f2
+3
+select @var;
+@var
+3
+drop table t1;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 3958ffded74..08f51494e20 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2887,3 +2887,32 @@ DROP FUNCTION f2;
DROP VIEW v1, v2;
DROP TABLE t1;
End of 5.0 tests.
+CREATE DATABASE bug21261DB;
+USE bug21261DB;
+CREATE TABLE t1 (x INT);
+CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
+GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
+GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
+CREATE TABLE t2 (y INT);
+GRANT SELECT ON t2 TO 'user21261'@'localhost';
+INSERT INTO v1 (x) VALUES (5);
+UPDATE v1 SET x=1;
+GRANT SELECT ON v1 TO 'user21261'@'localhost';
+GRANT SELECT ON t1 TO 'user21261'@'localhost';
+UPDATE v1,t2 SET x=1 WHERE x=y;
+SELECT * FROM t1;
+x
+1
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
+DROP USER 'user21261'@'localhost';
+DROP VIEW v1;
+DROP TABLE t1;
+DROP DATABASE bug21261DB;
+USE test;
+create table t1 (f1 datetime);
+create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
+show create view v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` where (`t1`.`f1` between now() and (now() + interval 1 minute))
+drop view v1;
+drop table t1;
diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test
index a42ba5ac88a..337035a8095 100644
--- a/mysql-test/t/compare.test
+++ b/mysql-test/t/compare.test
@@ -37,3 +37,12 @@ SELECT CHAR(31) = '', '' = CHAR(31);
SELECT CHAR(30) = '', '' = CHAR(30);
# End of 4.1 tests
+
+#
+#Bug #21159: Optimizer: wrong result after AND with different data types
+#
+create table t1 (a tinyint(1),b binary(1));
+insert into t1 values (0x01,0x01);
+select * from t1 where a=b;
+select * from t1 where a=b and b=0x01;
+drop table if exists t1;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 5d629dcdee1..81773dbf999 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -13,14 +13,13 @@
#events_stress : BUG#17619 2006-02-21 andrey Race conditions
#events : BUG#17619 2006-02-21 andrey Race conditions
#events_scheduling : BUG#19170 2006-04-26 andrey Test case of 19170 fails on some platforms. Has to be checked.
-#im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
+im_instance_conf : Bug#20294 2006-06-06 monty Instance manager test im_instance_conf fails randomly
im_options : Bug#20294 2006-07-24 stewart Instance manager test im_instance_conf fails randomly
#im_life_cycle : Bug#20368 2006-06-10 alik im_life_cycle test fails
ndb_autodiscover : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
ndb_autodiscover2 : BUG#18952 2006-02-16 jmiller Needs to be fixed w.r.t binlog
#ndb_binlog_ignore_db : BUG#21279 2006-07-25 ingo Randomly throws a warning
ndb_load : BUG#17233 2006-05-04 tomas failed load data from infile causes mysqld dbug_assert, binlog not flushed
-partition : BUG#21658 2006-08-16 Partition test fails, --ps-protocol
partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table
ps : BUG#21524 2006-08-08 pgalbraith 'ps' test fails in --ps-protocol test AMD64 bit
ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does not obtain LOCK_open
@@ -44,5 +43,7 @@ rpl_sp_effects : BUG#19862 2006-06-15 mkindahl
#rpl_truncate_7ndb : BUG#21298 2006-07-27 msvensson
crash_commit_before : 2006-08-02 msvensson
rpl_ndb_dd_advance : BUG#18679 2006-07-28 jimw (Test fails randomly)
+func_group : BUG#21924 2006-08-30 reggie
+func_in : BUG#21925 2006-08-30 reggie
ndb_binlog_discover : bug#21806 2006-08-24
ndb_autodiscover3 : bug#21806
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index ce1e4e59600..8a514108dc3 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -655,3 +655,15 @@ where t2.b=v1.a GROUP BY t2.b;
DROP VIEW v1;
DROP TABLE t1,t2;
+
+#
+# Bug #21174: Index degrades sort performance and
+# optimizer does not honor IGNORE INDEX
+#
+CREATE TABLE t1 (a INT, b INT, KEY(a));
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
+
+EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
+EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
+
+DROP TABLE t1;
diff --git a/mysql-test/t/index_merge_innodb.test b/mysql-test/t/index_merge_innodb.test
index 25f4e0b4e65..7e6c524e811 100644
--- a/mysql-test/t/index_merge_innodb.test
+++ b/mysql-test/t/index_merge_innodb.test
@@ -299,4 +299,31 @@ SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND
drop table t1;
+# BUG#21277: Index Merge/sort_union: wrong query results
+create table t1
+(
+ key1 int not null,
+ key2 int not null default 0,
+ key3 int not null default 0
+);
+
+insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
+
+let $1=7;
+set @d=8;
+while ($1)
+{
+ eval insert into t1 (key1) select key1+@d from t1;
+ eval set @d=@d*2;
+ dec $1;
+}
+
+alter table t1 add index i2(key2);
+alter table t1 add index i3(key3);
+update t1 set key2=key1,key3=key1;
+
+# to test the bug, the following must use "sort_union":
+explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
+select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
+drop table t1;
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index 2be53b58a39..58557507d9b 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -98,6 +98,33 @@ SELECT STRAIGHT_JOIN SQL_NO_CACHE t1.b, t1.a FROM t1, t3, t2 WHERE
t3.a = t2.a AND t2.b = t1.a AND t3.b = 1 AND t3.c IN (1, 2)
ORDER BY t1.b LIMIT 5;
DROP TABLE t1, t2, t3;
+
+
+# BUG#21077 (The testcase is not deterministic so correct execution doesn't
+# prove anything) For proof one should track if sequence of ha_innodb::* func
+# calls is correct.
+CREATE TABLE `t1` (`id1` INT) ;
+INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
+
+CREATE TABLE `t2` (
+ `id1` INT,
+ `id2` INT NOT NULL,
+ `id3` INT,
+ `id4` INT NOT NULL,
+ UNIQUE (`id2`,`id4`),
+ KEY (`id1`)
+) ENGINE=InnoDB;
+
+INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
+(1,1,1,0),
+(1,1,2,1),
+(5,1,2,2),
+(6,1,2,3),
+(1,2,2,2),
+(1,2,1,1);
+
+SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2);
+DROP TABLE t1, t2;
#
# Bug #12882 min/max inconsistent on empty table
#
@@ -263,6 +290,26 @@ explain select distinct f1 a, f1 b from t1;
explain select distinct f1, f2 from t1;
drop table t1;
+#
+# Test for bug #17164: ORed FALSE blocked conversion of outer join into join
+#
+
+CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
+ INDEX (name)) ENGINE=InnoDB;
+CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
+ FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
+INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
+
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+ WHERE t1.name LIKE 'A%';
+
+EXPLAIN
+SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
+ WHERE t1.name LIKE 'A%' OR FALSE;
+
+DROP TABLE t1,t2;
#
# Test of behaviour with CREATE ... SELECT
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 3f82219fadb..72a2935337d 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -765,7 +765,6 @@ DROP TABLE t1,t2;
# Test case moved to join_outer_innodb
-
#
# Bug 19396: LEFT OUTER JOIN over views in curly braces
#
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index afee381f5b7..49f8fc4d7d4 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -10,14 +10,18 @@ insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
-grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com";
-grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
connect (con1,localhost,ssl_user1,,,,,SSL);
connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,SSL);
connect (con4,localhost,ssl_user4,,,,,SSL);
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error 1045
+connect (con5,localhost,ssl_user5,,,,,SSL);
connection con1;
# Check ssl turned on
@@ -49,7 +53,7 @@ delete from t1;
connection default;
drop user ssl_user1@localhost, ssl_user2@localhost,
-ssl_user3@localhost, ssl_user4@localhost;
+ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 98e542dac95..1104c859ab8 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -578,3 +578,35 @@ INSERT INTO t1 VALUES (1,30), (2,20), (1,10), (2,30), (1,20), (2,10);
DROP TABLE t1;
# End of 4.1 tests
+
+#
+# Bug#21302: Result not properly sorted when using an ORDER BY on a second
+# table in a join
+#
+CREATE TABLE t1 (a int, b int, PRIMARY KEY (a));
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+
+explain SELECT t1.b as a, t2.b as c FROM
+ t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
+ORDER BY c;
+SELECT t2.b as c FROM
+ t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
+ORDER BY c;
+
+# check that it still removes sort of const table
+explain SELECT t1.b as a, t2.b as c FROM
+ t1 JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
+ORDER BY c;
+
+CREATE TABLE t2 LIKE t1;
+INSERT INTO t2 SELECT * from t1;
+CREATE TABLE t3 LIKE t1;
+INSERT INTO t3 SELECT * from t1;
+CREATE TABLE t4 LIKE t1;
+INSERT INTO t4 SELECT * from t1;
+INSERT INTO t1 values (0,0),(4,4);
+
+SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
+ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;
+
+DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index d4e930f91ec..532a63b0d24 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -4,12 +4,84 @@
# Taken fromm the select test
#
-- source include/have_partition.inc
+#
+# This test is disabled on Windows due to BUG#19107
+#
+-- source include/not_windows.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
#
+# Bug#14367: Partitions: crash if utf8 column
+#
+create table t1 (s1 char(2) character set utf8)
+partition by list (case when s1 > 'cz' then 1 else 2 end)
+(partition p1 values in (1),
+ partition p2 values in (2));
+drop table t1;
+
+#
+# Bug 15890: Strange number of partitions accepted
+#
+-- error 1064
+create table t1 (a int)
+partition by key(a)
+partitions 0.2+e1;
+-- error 1064
+create table t1 (a int)
+partition by key(a)
+partitions -1;
+-- error 1064
+create table t1 (a int)
+partition by key(a)
+partitions 1.5;
+-- error 1064
+create table t1 (a int)
+partition by key(a)
+partitions 1e+300;
+
+#
+# Bug 21173: SHOW TABLE STATUS crashes server in InnoDB
+#
+create table t1 (a int)
+engine = innodb
+partition by key (a);
+show table status;
+insert into t1 values (0), (1), (2), (3);
+show table status;
+drop table t1;
+
+create table t1 (a int auto_increment primary key)
+engine = innodb
+partition by key (a);
+show table status;
+insert into t1 values (NULL), (NULL), (NULL), (NULL);
+show table status;
+insert into t1 values (NULL), (NULL), (NULL), (NULL);
+show table status;
+drop table t1;
+
+#
+# Bug 21350: Data Directory problems
+#
+-- error 1103
+create table t1 (a int)
+partition by key (a)
+(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+
+#
+# Insert a test that manages to create the first partition and fails with
+# the second, ensure that we clean up afterwards in a proper manner.
+#
+--error 1103
+create table t1 (a int)
+partition by key (a)
+(partition p0,
+ partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
+
+#
# Bug 19309 Partitions: Crash if double procedural alter
#
create table t1 (a int)
@@ -881,15 +953,6 @@ show create table t2;
drop table t2;
#
-# Bug#14367: Partitions: crash if utf8 column
-#
-create table t1 (s1 char(2) character set utf8)
-partition by list (case when s1 > 'cz' then 1 else 2 end)
-(partition p1 values in (1),
- partition p2 values in (2));
-drop table t1;
-
-#
# Bug#15336 Partitions: crash if create table as select
#
create table t1 (f1 int) partition by hash (f1) as select 1;
@@ -1300,4 +1363,22 @@ eval ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
drop table t1;
--exec rmdir $MYSQLTEST_VARDIR/master-data/tmpdata || true
--exec rmdir $MYSQLTEST_VARDIR/master-data/tmpinx || true
+
+#
+# Bug 21388: Bigint fails to find record
+#
+create table t1 (a bigint unsigned not null, primary key(a))
+engine = myisam
+partition by key (a)
+partitions 10;
+
+show create table t1;
+insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE),
+(18446744073709551613), (18446744073709551612);
+select * from t1;
+select * from t1 where a = 18446744073709551615;
+delete from t1 where a = 18446744073709551615;
+select * from t1;
+drop table t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/partition_mgm.test b/mysql-test/t/partition_mgm.test
index 39512de154f..f1a89b28443 100644
--- a/mysql-test/t/partition_mgm.test
+++ b/mysql-test/t/partition_mgm.test
@@ -2,6 +2,23 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
+
+#
+# Bug 21143: mysqld hang when error in number of subparts in
+# REORGANIZE command
+#
+create table t1 (a int)
+partition by range (a)
+subpartition by key (a)
+(partition p0 values less than (10) (subpartition sp00, subpartition sp01),
+ partition p1 values less than (20) (subpartition sp10, subpartition sp11));
+
+-- error ER_PARTITION_WRONG_NO_SUBPART_ERROR
+alter table t1 reorganize partition p0 into
+(partition p0 values less than (10) (subpartition sp00,
+subpartition sp01, subpartition sp02));
+drop table t1;
+
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/t/partition_mgm_err2.test b/mysql-test/t/partition_mgm_err2.test
index 7d15bd7b19f..925178a720d 100644
--- a/mysql-test/t/partition_mgm_err2.test
+++ b/mysql-test/t/partition_mgm_err2.test
@@ -3,7 +3,12 @@
#
-- source include/have_partition.inc
+#
+# This test is disabled on windows due to BUG#19107
+#
+-- source include/not_windows.inc
-- require r/have_symlink.require
+
disable_query_log;
show variables like "have_symlink";
enable_query_log;
diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test
index 670b9333ab9..8719cbd98c4 100644
--- a/mysql-test/t/partition_range.test
+++ b/mysql-test/t/partition_range.test
@@ -10,6 +10,18 @@ drop table if exists t1;
--enable_warnings
#
+# Bug 21339: Crash in Explain Partitions
+#
+create table t1 (a date)
+engine = innodb
+partition by range (year(a))
+(partition p0 values less than (2006),
+ partition p1 values less than (2007));
+explain partitions select * from t1
+where a between '2006-01-01' and '2007-06-01';
+drop table t1;
+
+#
# More checks for partition pruning
#
create table t1 (a int unsigned)
@@ -686,3 +698,4 @@ EXPLAIN PARTITIONS SELECT * from t1
WHERE (a >= '2004-07-01' AND a <= '2004-09-30') OR
(a >= '2005-07-01' AND a <= '2005-09-30');
DROP TABLE t1;
+
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index 76929cf30e6..735d3f11359 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -656,3 +656,58 @@ explain select * from t1 where a not between 'b' and 'b';
select a, hex(filler) from t1 where a not between 'b' and 'b';
drop table t1,t2,t3;
+
+#
+# BUG#21282
+#
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, key(a));
+insert into t2 select 2*(A.a + 10*(B.a + 10*C.a)) from t1 A, t1 B, t1 C;
+
+set @a="select * from t2 force index (a) where a NOT IN(0";
+select count(*) from (select @a:=concat(@a, ',', a) from t2 ) Z;
+set @a=concat(@a, ')');
+
+insert into t2 values (11),(13),(15);
+
+set @b= concat("explain ", @a);
+
+prepare stmt1 from @b;
+execute stmt1;
+
+prepare stmt1 from @a;
+execute stmt1;
+
+drop table t1, t2;
+
+#
+# Bug #18165: range access for BETWEEN with a constant for the first argument
+#
+
+CREATE TABLE t1 (
+ id int NOT NULL DEFAULT '0',
+ b int NOT NULL DEFAULT '0',
+ c int NOT NULL DEFAULT '0',
+ INDEX idx1(b,c), INDEX idx2(c));
+
+INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
+
+INSERT INTO t1(b,c) VALUES (3,4), (3,4);
+
+SELECT * FROM t1 WHERE b<=3 AND 3<=c;
+SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
+
+EXPLAIN SELECT * FROM t1 WHERE b<=3 AND 3<=c;
+EXPLAIN SELECT * FROM t1 WHERE 3 BETWEEN b AND c;
+
+SELECT * FROM t1 WHERE 0 < b OR 0 > c;
+SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
+
+EXPLAIN SELECT * FROM t1 WHERE 0 < b OR 0 > c;
+EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
+
+DROP TABLE t1;
+
+
+# End of 5.0 tests
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 27c5a327ac8..a4a343dd167 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2958,3 +2958,44 @@ SELECT 0.9888889889 * 1.011111411911;
#
prepare stmt from 'select 1 as " a "';
execute stmt;
+
+#
+# Bug #21390: wrong estimate of rows after elimination of const tables
+#
+
+CREATE TABLE t1 (a int NOT NULL PRIMARY KEY, b int NOT NULL);
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
+
+CREATE TABLE t2 (c int NOT NULL, INDEX idx(c));
+INSERT INTO t2 VALUES
+ (1), (1), (1), (1), (1), (1), (1), (1),
+ (2), (2), (2), (2),
+ (3), (3),
+ (4);
+
+EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=1;
+EXPLAIN SELECT b FROM t1, t2 WHERE b=c AND a=4;
+
+DROP TABLE t1, t2;
+
+#
+# No matches for a join after substitution of a const table
+#
+
+CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a int);
+INSERT INTO t1 VALUES (1,2), (2,NULL), (3,2);
+
+CREATE TABLE t2 (b int, c INT, INDEX idx1(b));
+INSERT INTO t2 VALUES (2,1), (3,2);
+
+CREATE TABLE t3 (d int, e int, INDEX idx1(d));
+INSERT INTO t3 VALUES (2,10), (2,20), (1,30), (2,40), (2,50);
+
+EXPLAIN
+SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
+ WHERE t1.id=2;
+SELECT * FROM t1 LEFT JOIN t2 ON t2.b=t1.a INNER JOIN t3 ON t3.d=t1.id
+ WHERE t1.id=2;
+
+
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index c9ed62f0e54..ed122e9ff5a 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1868,7 +1868,30 @@ select * from t1 where NOT(s1+1 = ANY (select s1 from t1));
select * from t1 where (s1 = ALL (select s1/s1 from t1));
select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
drop table t1;
-# End of 4.1 tests
+
+#
+# Bug #16255: Subquery in where
+#
+create table t1 (
+ retailerID varchar(8) NOT NULL,
+ statusID int(10) unsigned NOT NULL,
+ changed datetime NOT NULL,
+ UNIQUE KEY retailerID (retailerID, statusID, changed)
+);
+
+INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
+INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
+INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
+INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
+
+select * from t1 r1
+ where (r1.retailerID,(r1.changed)) in
+ (SELECT r2.retailerId,(max(changed)) from t1 r2
+ group by r2.retailerId);
+drop table t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index f8953686c89..09576d415e5 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -114,3 +114,14 @@ select * from t1;
drop table t1;
# End of 4.1 tests
+
+#
+# Bug#21475: Wrongly applied constant propagation leads to a false comparison.
+#
+CREATE TABLE t1(a DATETIME NOT NULL);
+INSERT INTO t1 VALUES ('20060606155555');
+SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555");
+PREPARE s FROM 'SELECT a FROM t1 WHERE a=(SELECT MAX(a) FROM t1) AND (a="20060606155555")';
+EXECUTE s;
+DROP PREPARE s;
+DROP TABLE t1;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 58c52b59a5a..b2a9728de00 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -202,3 +202,13 @@ SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailur
SELECT @a;
drop table bigfailure;
+
+#
+# Bug#16861: User defined variable can have a wrong value if a tmp table was
+# used.
+#
+create table t1(f1 int, f2 int);
+insert into t1 values (1,2),(2,3),(3,1);
+select @var:=f2 from t1 group by f1 order by f2 desc limit 1;
+select @var;
+drop table t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 65607d677cd..9f818a4c9f2 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2797,3 +2797,45 @@ DROP TABLE t1;
--echo End of 5.0 tests.
+
+#
+# Bug #21261: Wrong access rights was required for an insert to a view
+#
+CREATE DATABASE bug21261DB;
+USE bug21261DB;
+CONNECT (root,localhost,root,,bug21261DB);
+CONNECTION root;
+
+CREATE TABLE t1 (x INT);
+CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
+GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
+GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
+CREATE TABLE t2 (y INT);
+GRANT SELECT ON t2 TO 'user21261'@'localhost';
+
+CONNECT (user21261, localhost, user21261,, bug21261DB);
+CONNECTION user21261;
+INSERT INTO v1 (x) VALUES (5);
+UPDATE v1 SET x=1;
+CONNECTION root;
+GRANT SELECT ON v1 TO 'user21261'@'localhost';
+GRANT SELECT ON t1 TO 'user21261'@'localhost';
+CONNECTION user21261;
+UPDATE v1,t2 SET x=1 WHERE x=y;
+CONNECTION root;
+SELECT * FROM t1;
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user21261'@'localhost';
+DROP USER 'user21261'@'localhost';
+DROP VIEW v1;
+DROP TABLE t1;
+DROP DATABASE bug21261DB;
+USE test;
+
+#
+# Bug #15950: NOW() optimized away in VIEWs
+#
+create table t1 (f1 datetime);
+create view v1 as select * from t1 where f1 between now() and now() + interval 1 minute;
+show create view v1;
+drop view v1;
+drop table t1;
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 7f4d6abd4b7..82372c20e41 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2363,8 +2363,7 @@ ha_innobase::open(
"have forgotten\nto delete the corresponding "
".frm files of InnoDB tables, or you\n"
"have moved .frm files to another database?\n"
- "Look from section 15.1 of "
- "http://www.innodb.com/ibman.html\n"
+ "See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"how you can resolve the problem.\n",
norm_name);
free_share(share);
@@ -2381,8 +2380,7 @@ ha_innobase::open(
"Have you deleted the .ibd file from the "
"database directory under\nthe MySQL datadir, "
"or have you used DISCARD TABLESPACE?\n"
- "Look from section 15.1 of "
- "http://www.innodb.com/ibman.html\n"
+ "See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"how you can resolve the problem.\n",
norm_name);
free_share(share);
@@ -5602,13 +5600,14 @@ ha_innobase::info(
for (i = 0; i < table->s->keys; i++) {
if (index == NULL) {
ut_print_timestamp(stderr);
- sql_print_error("Table %s contains less "
+ sql_print_error("Table %s contains fewer "
"indexes inside InnoDB than "
"are defined in the MySQL "
".frm file. Have you mixed up "
".frm files from different "
- "installations? See section "
- "15.1 at http://www.innodb.com/ibman.html",
+ "installations? See "
+"http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+
ib_table->name);
break;
}
@@ -5617,17 +5616,11 @@ ha_innobase::info(
if (j + 1 > index->n_uniq) {
ut_print_timestamp(stderr);
- sql_print_error("Index %s of %s has "
- "%lu columns unique "
- "inside InnoDB, but "
- "MySQL is asking "
- "statistics for %lu "
- "columns. Have you "
- "mixed up .frm files "
- "from different "
- "installations? See "
- "section 15.1 at "
- "http://www.innodb.com/ibman.html",
+ sql_print_error(
+"Index %s of %s has %lu columns unique inside InnoDB, but MySQL is asking "
+"statistics for %lu columns. Have you mixed up .frm files from different "
+"installations? "
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
index->name,
ib_table->name,
(unsigned long)
@@ -6436,7 +6429,7 @@ ha_innobase::transactional_table_lock(
"table %s does not exist.\n"
"Have you deleted the .ibd file from the database directory under\n"
"the MySQL datadir?"
-"Look from section 15.1 of http://www.innodb.com/ibman.html\n"
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"how you can resolve the problem.\n",
prebuilt->table->name);
DBUG_RETURN(HA_ERR_CRASHED);
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index ee0667b92bd..30c64760c88 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -1134,7 +1134,9 @@ int ha_partition::prepare_new_partition(TABLE *table,
bool open_flag= FALSE;
DBUG_ENTER("prepare_new_partition");
- set_up_table_before_create(table, part_name, create_info, 0, p_elem);
+ if ((error= set_up_table_before_create(table, part_name, create_info,
+ 0, p_elem)))
+ goto error;
if ((error= file->create(part_name, table, create_info)))
goto error;
create_flag= TRUE;
@@ -1343,9 +1345,9 @@ int ha_partition::change_partitions(HA_CREATE_INFO *create_info,
ones used to be.
*/
first= FALSE;
- DBUG_ASSERT(i + m_reorged_parts <= m_file_tot_parts);
+ DBUG_ASSERT(((i*no_subparts) + m_reorged_parts) <= m_file_tot_parts);
memcpy((void*)m_reorged_file, &m_file[i*no_subparts],
- sizeof(handler*)*m_reorged_parts*no_subparts);
+ sizeof(handler*)*m_reorged_parts);
}
} while (++i < no_parts);
}
@@ -1579,6 +1581,17 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
}
+void ha_partition::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
+{
+ handler **file_array= m_file;
+ table= table_arg;
+ table_share= share;
+ do
+ {
+ (*file_array)->change_table_ptr(table_arg, share);
+ } while (*(++file_array));
+}
+
/*
Change comments specific to handler
@@ -1633,7 +1646,7 @@ uint ha_partition::del_ren_cre_table(const char *from,
char from_buff[FN_REFLEN], to_buff[FN_REFLEN];
char *name_buffer_ptr;
uint i;
- handler **file;
+ handler **file, **abort_file;
DBUG_ENTER("del_ren_cre_table()");
if (get_from_handler_file(from, current_thd->mem_root))
@@ -1657,8 +1670,10 @@ uint ha_partition::del_ren_cre_table(const char *from,
error= (*file)->delete_table((const char*) from_buff);
else
{
- set_up_table_before_create(table_arg, from_buff, create_info, i, NULL);
- error= (*file)->create(from_buff, table_arg, create_info);
+ if ((error= set_up_table_before_create(table_arg, from_buff,
+ create_info, i, NULL)) ||
+ ((error= (*file)->create(from_buff, table_arg, create_info))))
+ goto create_error;
}
name_buffer_ptr= strend(name_buffer_ptr) + 1;
if (error)
@@ -1666,6 +1681,16 @@ uint ha_partition::del_ren_cre_table(const char *from,
i++;
} while (*(++file));
DBUG_RETURN(save_error);
+create_error:
+ name_buffer_ptr= m_name_buffer_ptr;
+ for (abort_file= file, file= m_file; file < abort_file; file++)
+ {
+ create_partition_name(from_buff, from, name_buffer_ptr, NORMAL_PART_NAME,
+ FALSE);
+ VOID((*file)->delete_table((const char*) from_buff));
+ name_buffer_ptr= strend(name_buffer_ptr) + 1;
+ }
+ DBUG_RETURN(error);
}
/*
@@ -1720,7 +1745,8 @@ partition_element *ha_partition::find_partition_element(uint part_id)
part_id Partition id of partition to set-up
RETURN VALUE
- NONE
+ TRUE Error
+ FALSE Success
DESCRIPTION
Set up
@@ -1730,31 +1756,40 @@ partition_element *ha_partition::find_partition_element(uint part_id)
4) Data file name on partition
*/
-void ha_partition::set_up_table_before_create(TABLE *table,
- const char *partition_name_with_path,
- HA_CREATE_INFO *info,
- uint part_id,
- partition_element *part_elem)
+int ha_partition::set_up_table_before_create(TABLE *table,
+ const char *partition_name_with_path,
+ HA_CREATE_INFO *info,
+ uint part_id,
+ partition_element *part_elem)
{
+ int error= 0;
+ const char *partition_name;
+ THD *thd= current_thd;
+ DBUG_ENTER("set_up_table_before_create");
+
if (!part_elem)
{
part_elem= find_partition_element(part_id);
if (!part_elem)
- return; // Fatal error
+ DBUG_RETURN(1); // Fatal error
}
table->s->max_rows= part_elem->part_max_rows;
table->s->min_rows= part_elem->part_min_rows;
- const char *partition_name= strrchr(partition_name_with_path, FN_LIBCHAR);
- if (part_elem->index_file_name)
- append_file_to_dir(current_thd,
- (const char**)&part_elem->index_file_name,
- partition_name+1);
- if (part_elem->data_file_name)
- append_file_to_dir(current_thd,
- (const char**)&part_elem->data_file_name,
- partition_name+1);
+ partition_name= strrchr(partition_name_with_path, FN_LIBCHAR);
+ if ((part_elem->index_file_name &&
+ (error= append_file_to_dir(thd,
+ (const char**)&part_elem->index_file_name,
+ partition_name+1))) ||
+ (part_elem->data_file_name &&
+ (error= append_file_to_dir(thd,
+ (const char**)&part_elem->data_file_name,
+ partition_name+1))))
+ {
+ DBUG_RETURN(error);
+ }
info->index_file_name= part_elem->index_file_name;
info->data_file_name= part_elem->data_file_name;
+ DBUG_RETURN(0);
}
@@ -4183,9 +4218,19 @@ void ha_partition::info(uint flag)
ulonglong nb_reserved_values;
DBUG_PRINT("info", ("HA_STATUS_AUTO"));
/* we don't want to reserve any values, it's pure information */
- get_auto_increment(0, 0, 0, &stats.auto_increment_value,
- &nb_reserved_values);
- release_auto_increment();
+
+ if (table->found_next_number_field)
+ {
+ /*
+ Can only call get_auto_increment for tables that actually
+ have auto_increment columns, otherwise there will be
+ problems in handlers that don't expect get_auto_increment
+ for non-autoincrement tables.
+ */
+ get_auto_increment(0, 0, 0, &stats.auto_increment_value,
+ &nb_reserved_values);
+ release_auto_increment();
+ }
}
if (flag & HA_STATUS_VARIABLE)
{
@@ -5145,13 +5190,12 @@ void ha_partition::print_error(int error, myf errflag)
DBUG_ENTER("ha_partition::print_error");
/* Should probably look for my own errors first */
- /* monty: needs to be called for the last used partition ! */
DBUG_PRINT("enter", ("error: %d", error));
if (error == HA_ERR_NO_PARTITION_FOUND)
m_part_info->print_no_partition_found(table);
else
- m_file[0]->print_error(error, errflag);
+ m_file[m_last_part]->print_error(error, errflag);
DBUG_VOID_RETURN;
}
@@ -5161,8 +5205,7 @@ bool ha_partition::get_error_message(int error, String *buf)
DBUG_ENTER("ha_partition::get_error_message");
/* Should probably look for my own errors first */
- /* monty: needs to be called for the last used partition ! */
- DBUG_RETURN(m_file[0]->get_error_message(error, buf));
+ DBUG_RETURN(m_file[m_last_part]->get_error_message(error, buf));
}
@@ -5363,7 +5406,6 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
if (increment) // If not check for values
*nb_reserved_values= (last_value == ULONGLONG_MAX) ?
ULONGLONG_MAX : ((last_value - *first_value) / increment);
-
DBUG_VOID_RETURN;
}
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index c62f21cfaa1..97086d7b632 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -199,6 +199,7 @@ public:
*no_parts= m_tot_parts;
DBUG_RETURN(0);
}
+ virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
private:
int prepare_for_delete();
int copy_partitions(ulonglong *copied, ulonglong *deleted);
@@ -222,11 +223,11 @@ private:
bool new_handlers_from_part_info(MEM_ROOT *mem_root);
bool create_handlers(MEM_ROOT *mem_root);
void clear_handler_file();
- void set_up_table_before_create(TABLE *table_arg,
- const char *partition_name_with_path,
- HA_CREATE_INFO *info,
- uint part_id,
- partition_element *p_elem);
+ int set_up_table_before_create(TABLE *table_arg,
+ const char *partition_name_with_path,
+ HA_CREATE_INFO *info,
+ uint part_id,
+ partition_element *p_elem);
partition_element *find_partition_element(uint part_id);
public:
diff --git a/sql/handler.h b/sql/handler.h
index bfc502b0658..df40a207916 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -985,7 +985,7 @@ public:
virtual void print_error(int error, myf errflag);
virtual bool get_error_message(int error, String *buf);
uint get_dup_key(int error);
- void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
+ virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
{
table= table_arg;
table_share= share;
diff --git a/sql/item.cc b/sql/item.cc
index 29c99a17944..577eff3e5f6 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -302,6 +302,7 @@ Item::Item():
maybe_null=null_value=with_sum_func=unsigned_flag=0;
decimals= 0; max_length= 0;
with_subselect= 0;
+ cmp_context= (Item_result)-1;
/* Put item in free list so that we can free all items at end */
THD *thd= current_thd;
@@ -340,7 +341,8 @@ Item::Item(THD *thd, Item *item):
unsigned_flag(item->unsigned_flag),
with_sum_func(item->with_sum_func),
fixed(item->fixed),
- collation(item->collation)
+ collation(item->collation),
+ cmp_context(item->cmp_context)
{
next= thd->free_list; // Put in free list
thd->free_list= this;
@@ -1535,7 +1537,7 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
been created in prepare. In this case register the change for
rollback.
*/
- if (arena)
+ if (thd->is_stmt_prepare())
*arg= conv;
else
thd->change_item_tree(arg, conv);
@@ -3871,7 +3873,19 @@ Item *Item_field::equal_fields_propagator(byte *arg)
Item *item= 0;
if (item_equal)
item= item_equal->get_const();
- if (!item)
+ /*
+ Disable const propagation for items used in different comparison contexts.
+ This must be done because, for example, Item_hex_string->val_int() is not
+ the same as (Item_hex_string->val_str() in BINARY column)->val_int().
+ We cannot simply disable the replacement in a particular context (
+ e.g. <bin_col> = <int_col> AND <bin_col> = <hex_string>) since
+ Items don't know the context they are in and there are functions like
+ IF (<hex_string>, 'yes', 'no').
+ The same problem occurs when comparing a DATE/TIME field with a
+ DATE/TIME represented as an int and as a string.
+ */
+ if (!item ||
+ (cmp_context != (Item_result)-1 && item->cmp_context != cmp_context))
item= this;
return item;
}
diff --git a/sql/item.h b/sql/item.h
index 81480ce8146..f5a5e6e4fd9 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -495,7 +495,7 @@ public:
my_bool with_subselect; /* If this item is a subselect or some
of its arguments is or contains a
subselect */
-
+ Item_result cmp_context; /* Comparison context */
// alloc & destruct is done as start of select using sql_alloc
Item();
/*
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 4d793af4f93..fd0b348ac85 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -125,31 +125,39 @@ static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems)
uchar null_byte;
Field *field= NULL;
- /* Search for date/time fields/functions */
- for (i= 0; i < nitems; i++)
+ /*
+ Do not convert items while creating a or showing a view in order
+ to store/display the original query in these cases.
+ */
+ if (thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
+ thd->lex->sql_command != SQLCOM_SHOW_CREATE)
{
- if (!items[i]->result_as_longlong())
+ /* Search for date/time fields/functions */
+ for (i= 0; i < nitems; i++)
{
- /* Do not convert anything if a string field/function is present */
- if (!items[i]->const_item() && items[i]->result_type() == STRING_RESULT)
+ if (!items[i]->result_as_longlong())
+ {
+ /* Do not convert anything if a string field/function is present */
+ if (!items[i]->const_item() && items[i]->result_type() == STRING_RESULT)
+ {
+ i= nitems;
+ break;
+ }
+ continue;
+ }
+ if ((res= items[i]->real_item()->type()) == Item::FIELD_ITEM &&
+ items[i]->result_type() != INT_RESULT)
{
- i= nitems;
+ field= ((Item_field *)items[i]->real_item())->field;
+ break;
+ }
+ else if (res == Item::FUNC_ITEM)
+ {
+ field= items[i]->tmp_table_field_from_field_type(0,0);
+ if (field)
+ field->move_field(buff, &null_byte, 0);
break;
}
- continue;
- }
- if ((res= items[i]->real_item()->type()) == Item::FIELD_ITEM &&
- items[i]->result_type() != INT_RESULT)
- {
- field= ((Item_field *)items[i]->real_item())->field;
- break;
- }
- else if (res == Item::FUNC_ITEM)
- {
- field= items[i]->tmp_table_field_from_field_type(0, 0);
- if (field)
- field->move_field(buff, &null_byte, 0);
- break;
}
}
if (field)
@@ -412,7 +420,8 @@ void Item_bool_func2::fix_length_and_dec()
agg_arg_charsets(coll, args, 2, MY_COLL_CMP_CONV, 1))
return;
-
+ args[0]->cmp_context= args[1]->cmp_context=
+ item_cmp_type(args[0]->result_type(), args[1]->result_type());
// Make a special case of compare with fields to get nicer DATE comparisons
if (functype() == LIKE_FUNC) // Disable conversion in case of LIKE function.
@@ -433,6 +442,7 @@ void Item_bool_func2::fix_length_and_dec()
{
cmp.set_cmp_func(this, tmp_arg, tmp_arg+1,
INT_RESULT); // Works for all types.
+ args[0]->cmp_context= args[1]->cmp_context= INT_RESULT;
return;
}
}
@@ -447,6 +457,7 @@ void Item_bool_func2::fix_length_and_dec()
{
cmp.set_cmp_func(this, tmp_arg, tmp_arg+1,
INT_RESULT); // Works for all types.
+ args[0]->cmp_context= args[1]->cmp_context= INT_RESULT;
return;
}
}
@@ -1224,6 +1235,7 @@ void Item_func_between::fix_length_and_dec()
if (!args[0] || !args[1] || !args[2])
return;
agg_cmp_type(thd, &cmp_type, args, 3);
+ args[0]->cmp_context= args[1]->cmp_context= args[2]->cmp_context= cmp_type;
if (cmp_type == STRING_RESULT)
agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV, 1);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index ace4acc5245..c4361663873 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -560,7 +560,7 @@ void Item_func::signal_divide_by_null()
Item *Item_func::get_tmp_table_item(THD *thd)
{
- if (!with_sum_func && !const_item())
+ if (!with_sum_func && !const_item() && functype() != SUSERVAR_FUNC)
return new Item_field(result_field);
return copy_or_same(thd);
}
@@ -3750,30 +3750,38 @@ my_decimal *user_var_entry::val_decimal(my_bool *null_value, my_decimal *val)
*/
bool
-Item_func_set_user_var::check()
+Item_func_set_user_var::check(bool use_result_field)
{
DBUG_ENTER("Item_func_set_user_var::check");
+ if (use_result_field)
+ DBUG_ASSERT(result_field);
switch (cached_result_type) {
case REAL_RESULT:
{
- save_result.vreal= args[0]->val_real();
+ save_result.vreal= use_result_field ? result_field->val_real() :
+ args[0]->val_real();
break;
}
case INT_RESULT:
{
- save_result.vint= args[0]->val_int();
- unsigned_flag= args[0]->unsigned_flag;
+ save_result.vint= use_result_field ? result_field->val_int() :
+ args[0]->val_int();
+ unsigned_flag= use_result_field ? ((Field_num*)result_field)->unsigned_flag:
+ args[0]->unsigned_flag;
break;
}
case STRING_RESULT:
{
- save_result.vstr= args[0]->val_str(&value);
+ save_result.vstr= use_result_field ? result_field->val_str(&value) :
+ args[0]->val_str(&value);
break;
}
case DECIMAL_RESULT:
{
- save_result.vdec= args[0]->val_decimal(&decimal_buff);
+ save_result.vdec= use_result_field ?
+ result_field->val_decimal(&decimal_buff) :
+ args[0]->val_decimal(&decimal_buff);
break;
}
case ROW_RESULT:
@@ -3859,7 +3867,7 @@ Item_func_set_user_var::update()
double Item_func_set_user_var::val_real()
{
DBUG_ASSERT(fixed == 1);
- check();
+ check(0);
update(); // Store expression
return entry->val_real(&null_value);
}
@@ -3867,7 +3875,7 @@ double Item_func_set_user_var::val_real()
longlong Item_func_set_user_var::val_int()
{
DBUG_ASSERT(fixed == 1);
- check();
+ check(0);
update(); // Store expression
return entry->val_int(&null_value);
}
@@ -3875,7 +3883,7 @@ longlong Item_func_set_user_var::val_int()
String *Item_func_set_user_var::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);
- check();
+ check(0);
update(); // Store expression
return entry->val_str(&null_value, str, decimals);
}
@@ -3884,7 +3892,7 @@ String *Item_func_set_user_var::val_str(String *str)
my_decimal *Item_func_set_user_var::val_decimal(my_decimal *val)
{
DBUG_ASSERT(fixed == 1);
- check();
+ check(0);
update(); // Store expression
return entry->val_decimal(&null_value, val);
}
@@ -3909,6 +3917,29 @@ void Item_func_set_user_var::print_as_stmt(String *str)
str->append(')');
}
+bool Item_func_set_user_var::send(Protocol *protocol, String *str_arg)
+{
+ if (result_field)
+ {
+ check(1);
+ update();
+ return protocol->store(result_field);
+ }
+ return Item::send(protocol, str_arg);
+}
+
+void Item_func_set_user_var::make_field(Send_field *tmp_field)
+{
+ if (result_field)
+ {
+ result_field->make_field(tmp_field);
+ DBUG_ASSERT(tmp_field->table_name != 0);
+ if (Item::name)
+ tmp_field->col_name=Item::name; // Use user supplied name
+ }
+ else
+ Item::make_field(tmp_field);
+}
String *
Item_func_get_user_var::val_str(String *str)
@@ -4174,7 +4205,7 @@ bool Item_func_get_user_var::set_value(THD *thd,
Item_func_set_user_var is not fixed after construction, call
fix_fields().
*/
- return (!suv || suv->fix_fields(thd, it) || suv->check() || suv->update());
+ return (!suv || suv->fix_fields(thd, it) || suv->check(0) || suv->update());
}
diff --git a/sql/item_func.h b/sql/item_func.h
index 168430a5a11..9e0ff25155a 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -54,7 +54,7 @@ public:
SP_POINTN,SP_GEOMETRYN,SP_INTERIORRINGN,
NOT_FUNC, NOT_ALL_FUNC,
NOW_FUNC, TRIG_COND_FUNC,
- GUSERVAR_FUNC, COLLATE_FUNC,
+ SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC,
EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC };
enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL,
OPTIMIZE_EQUAL };
@@ -1196,13 +1196,16 @@ public:
Item_func_set_user_var(LEX_STRING a,Item *b)
:Item_func(b), cached_result_type(INT_RESULT), name(a)
{}
+ enum Functype functype() const { return SUSERVAR_FUNC; }
double val_real();
longlong val_int();
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
bool update_hash(void *ptr, uint length, enum Item_result type,
CHARSET_INFO *cs, Derivation dv, bool unsigned_arg= 0);
- bool check();
+ bool send(Protocol *protocol, String *str_arg);
+ void make_field(Send_field *tmp_field);
+ bool check(bool use_result_field);
bool update();
enum Item_result result_type () const { return cached_result_type; }
bool fix_fields(THD *thd, Item **ref);
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index e24a57809f2..4e6c67cba60 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -1141,24 +1141,23 @@ Item_in_subselect::row_value_transformer(JOIN *join)
DBUG_RETURN(RES_ERROR);
Item *item_eq=
new Item_func_eq(new
- Item_direct_ref(&select_lex->context,
- (*optimizer->get_cache())->
- addr(i),
- (char *)"<no matter>",
- (char *)in_left_expr_name),
+ Item_ref(&select_lex->context,
+ (*optimizer->get_cache())->
+ addr(i),
+ (char *)"<no matter>",
+ (char *)in_left_expr_name),
new
- Item_direct_ref(&select_lex->context,
- select_lex->ref_pointer_array + i,
- (char *)"<no matter>",
- (char *)"<list ref>")
+ Item_ref(&select_lex->context,
+ select_lex->ref_pointer_array + i,
+ (char *)"<no matter>",
+ (char *)"<list ref>")
);
Item *item_isnull=
new Item_func_isnull(new
- Item_direct_ref(&select_lex->context,
- select_lex->
- ref_pointer_array+i,
- (char *)"<no matter>",
- (char *)"<list ref>")
+ Item_ref(&select_lex->context,
+ select_lex->ref_pointer_array+i,
+ (char *)"<no matter>",
+ (char *)"<list ref>")
);
having_item=
and_items(having_item,
@@ -1168,11 +1167,11 @@ Item_in_subselect::row_value_transformer(JOIN *join)
new
Item_is_not_null_test(this,
new
- Item_direct_ref(&select_lex->context,
- select_lex->
- ref_pointer_array + i,
- (char *)"<no matter>",
- (char *)"<list ref>")
+ Item_ref(&select_lex->context,
+ select_lex->
+ ref_pointer_array + i,
+ (char *)"<no matter>",
+ (char *)"<list ref>")
)
);
item_having_part2->top_level_item();
@@ -1228,11 +1227,11 @@ Item_in_subselect::row_value_transformer(JOIN *join)
new
Item_is_not_null_test(this,
new
- Item_direct_ref(&select_lex->context,
- select_lex->
- ref_pointer_array + i,
- (char *)"<no matter>",
- (char *)"<list ref>")
+ Item_ref(&select_lex->context,
+ select_lex->
+ ref_pointer_array + i,
+ (char *)"<no matter>",
+ (char *)"<list ref>")
)
);
item_isnull= new
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index f603cafd89d..a259fd90485 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -224,7 +224,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
tmp= (char*) val + min(2, val_len);
l_time->day= (int) my_strtoll10(val, &tmp, &error);
/* Skip 'st, 'nd, 'th .. */
- val= tmp + min((int) (end-tmp), 2);
+ val= tmp + min((int) (val_end-tmp), 2);
break;
/* Hour */
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 3bbe38adf78..473de1951e5 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -111,6 +111,15 @@ typedef struct my_locale_st
TYPELIB *ab_month_names;
TYPELIB *day_names;
TYPELIB *ab_day_names;
+#ifdef __cplusplus
+ my_locale_st(const char *name_par, const char *descr_par, bool is_ascii_par,
+ TYPELIB *month_names_par, TYPELIB *ab_month_names_par,
+ TYPELIB *day_names_par, TYPELIB *ab_day_names_par) :
+ name(name_par), description(descr_par), is_ascii(is_ascii_par),
+ month_names(month_names_par), ab_month_names(ab_month_names_par),
+ day_names(day_names_par), ab_day_names(ab_day_names_par)
+ {}
+#endif
} MY_LOCALE;
extern MY_LOCALE my_locale_en_US;
@@ -1132,6 +1141,7 @@ bool setup_tables_and_check_access(THD *thd,
TABLE_LIST *tables,
TABLE_LIST **leaves,
bool select_insert,
+ ulong want_access_first,
ulong want_access);
int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
List<Item> *sum_func_list, uint wild_num);
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index a5a46ba11b6..3f133924469 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -549,6 +549,7 @@ public:
uint fields_bitmap_size;
MY_BITMAP needed_fields; /* bitmask of fields needed by the query */
+ MY_BITMAP tmp_covered_fields;
key_map *needed_reg; /* ptr to SQL_SELECT::needed_reg */
@@ -1916,6 +1917,7 @@ static int fill_used_fields_bitmap(PARAM *param)
TABLE *table= param->table;
my_bitmap_map *tmp;
uint pk;
+ param->tmp_covered_fields.bitmap= 0;
param->fields_bitmap_size= table->s->column_bitmap_size;
if (!(tmp= (my_bitmap_map*) alloc_root(param->mem_root,
param->fields_bitmap_size)) ||
@@ -4494,11 +4496,15 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
/*I=set of all covering indexes */
ror_scan_mark= tree->ror_scans;
- my_bitmap_map int_buf[MAX_KEY/(sizeof(my_bitmap_map)*8)+1];
- MY_BITMAP covered_fields;
- if (bitmap_init(&covered_fields, int_buf, param->table->s->fields, FALSE))
+ MY_BITMAP *covered_fields= &param->tmp_covered_fields;
+ if (!covered_fields->bitmap)
+ covered_fields->bitmap= (my_bitmap_map*)alloc_root(param->mem_root,
+ param->fields_bitmap_size);
+ if (!covered_fields->bitmap ||
+ bitmap_init(covered_fields, covered_fields->bitmap,
+ param->table->s->fields, FALSE))
DBUG_RETURN(0);
- bitmap_clear_all(&covered_fields);
+ bitmap_clear_all(covered_fields);
double total_cost= 0.0f;
ha_rows records=0;
@@ -4518,7 +4524,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
*/
for (ROR_SCAN_INFO **scan= ror_scan_mark; scan != ror_scans_end; ++scan)
{
- bitmap_subtract(&(*scan)->covered_fields, &covered_fields);
+ bitmap_subtract(&(*scan)->covered_fields, covered_fields);
(*scan)->used_fields_covered=
bitmap_bits_set(&(*scan)->covered_fields);
(*scan)->first_uncovered_field=
@@ -4540,8 +4546,8 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
if (total_cost > read_time)
DBUG_RETURN(NULL);
/* F=F-covered by first(I) */
- bitmap_union(&covered_fields, &(*ror_scan_mark)->covered_fields);
- all_covered= bitmap_is_subset(&param->needed_fields, &covered_fields);
+ bitmap_union(covered_fields, &(*ror_scan_mark)->covered_fields);
+ all_covered= bitmap_is_subset(&param->needed_fields, covered_fields);
} while ((++ror_scan_mark < ror_scans_end) && !all_covered);
if (!all_covered || (ror_scan_mark - tree->ror_scans) == 1)
@@ -4876,25 +4882,37 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
break;
case Item_func::BETWEEN:
- if (inv)
- {
- tree= get_ne_mm_tree(param, cond_func, field, cond_func->arguments()[1],
- cond_func->arguments()[2], cmp_type);
- }
- else
+ {
+ if (!value)
{
- tree= get_mm_parts(param, cond_func, field, Item_func::GE_FUNC,
- cond_func->arguments()[1],cmp_type);
- if (tree)
+ if (inv)
{
- tree= tree_and(param, tree, get_mm_parts(param, cond_func, field,
- Item_func::LE_FUNC,
- cond_func->arguments()[2],
- cmp_type));
+ tree= get_ne_mm_tree(param, cond_func, field, cond_func->arguments()[1],
+ cond_func->arguments()[2], cmp_type);
+ }
+ else
+ {
+ tree= get_mm_parts(param, cond_func, field, Item_func::GE_FUNC,
+ cond_func->arguments()[1],cmp_type);
+ if (tree)
+ {
+ tree= tree_and(param, tree, get_mm_parts(param, cond_func, field,
+ Item_func::LE_FUNC,
+ cond_func->arguments()[2],
+ cmp_type));
+ }
}
}
+ else
+ tree= get_mm_parts(param, cond_func, field,
+ (inv ?
+ (value == (Item*)1 ? Item_func::GT_FUNC :
+ Item_func::LT_FUNC):
+ (value == (Item*)1 ? Item_func::LE_FUNC :
+ Item_func::GE_FUNC)),
+ cond_func->arguments()[0], cmp_type);
break;
-
+ }
case Item_func::IN_FUNC:
{
Item_func_in *func=(Item_func_in*) cond_func;
@@ -4904,41 +4922,33 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
if (func->array && func->cmp_type != ROW_RESULT)
{
/*
- We get here for conditions in form "t.key NOT IN (c1, c2, ...)"
- (where c{i} are constants).
- Our goal is to produce a SEL_ARG graph that represents intervals:
+ We get here for conditions in form "t.key NOT IN (c1, c2, ...)",
+ where c{i} are constants. Our goal is to produce a SEL_TREE that
+ represents intervals:
($MIN<t.key<c1) OR (c1<t.key<c2) OR (c2<t.key<c3) OR ... (*)
where $MIN is either "-inf" or NULL.
- The most straightforward way to handle NOT IN would be to convert
- it to "(t.key != c1) AND (t.key != c2) AND ..." and let the range
- optimizer to build SEL_ARG graph from that. However that will cause
- the range optimizer to use O(N^2) memory (it's a bug, not filed),
- and people do use big NOT IN lists (see BUG#15872). Also, for big
- NOT IN lists constructing/using graph (*) does not make the query
- faster.
-
- So, we will handle NOT IN manually in the following way:
- * if the number of entries in the NOT IN list is less then
- NOT_IN_IGNORE_THRESHOLD, we will construct SEL_ARG graph (*)
- manually.
- * Otherwise, we will construct a smaller graph: for
- "t.key NOT IN (c1,...cN)" we construct a graph representing
- ($MIN < t.key) OR (cN < t.key) // here sequence of c_i is
- // ordered.
-
- A note about partially-covering indexes: for those (e.g. for
- "a CHAR(10), KEY(a(5))") the handling is correct (albeit not very
- efficient):
- Instead of "t.key < c1" we get "t.key <= prefix-val(c1)".
- Combining the intervals in (*) together, we get:
- (-inf<=t.key<=c1) OR (c1<=t.key<=c2) OR (c2<=t.key<=c3) OR ...
- i.e. actually we get intervals combined into one interval:
- (-inf<=t.key<=+inf). This doesn't make much sense but it doesn't
- cause any problems.
+ The most straightforward way to produce it is to convert NOT IN
+ into "(t.key != c1) AND (t.key != c2) AND ... " and let the range
+ analyzer to build SEL_TREE from that. The problem is that the
+ range analyzer will use O(N^2) memory (which is probably a bug),
+ and people do use big NOT IN lists (e.g. see BUG#15872, BUG#21282),
+ will run out of memory.
+
+ Another problem with big lists like (*) is that a big list is
+ unlikely to produce a good "range" access, while considering that
+ range access will require expensive CPU calculations (and for
+ MyISAM even index accesses). In short, big NOT IN lists are rarely
+ worth analyzing.
+
+ Considering the above, we'll handle NOT IN as follows:
+ * if the number of entries in the NOT IN list is less than
+ NOT_IN_IGNORE_THRESHOLD, construct the SEL_TREE (*) manually.
+ * Otherwise, don't produce a SEL_TREE.
*/
+#define NOT_IN_IGNORE_THRESHOLD 1000
MEM_ROOT *tmp_root= param->mem_root;
param->thd->mem_root= param->old_root;
/*
@@ -4952,9 +4962,9 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
Item *value_item= func->array->create_item();
param->thd->mem_root= tmp_root;
- if (!value_item)
+ if (func->array->count > NOT_IN_IGNORE_THRESHOLD || !value_item)
break;
-
+
/* Get a SEL_TREE for "(-inf|NULL) < X < c_0" interval. */
uint i=0;
do
@@ -4973,45 +4983,39 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
tree= NULL;
break;
}
-#define NOT_IN_IGNORE_THRESHOLD 1000
SEL_TREE *tree2;
- if (func->array->count < NOT_IN_IGNORE_THRESHOLD)
+ for (; i < func->array->count; i++)
{
- for (; i < func->array->count; i++)
+ if (func->array->compare_elems(i, i-1))
{
- if (func->array->compare_elems(i, i-1))
+ /* Get a SEL_TREE for "-inf < X < c_i" interval */
+ func->array->value_to_item(i, value_item);
+ tree2= get_mm_parts(param, cond_func, field, Item_func::LT_FUNC,
+ value_item, cmp_type);
+ if (!tree2)
{
- /* Get a SEL_TREE for "-inf < X < c_i" interval */
- func->array->value_to_item(i, value_item);
- tree2= get_mm_parts(param, cond_func, field, Item_func::LT_FUNC,
- value_item, cmp_type);
- if (!tree2)
- {
- tree= NULL;
- break;
- }
+ tree= NULL;
+ break;
+ }
- /* Change all intervals to be "c_{i-1} < X < c_i" */
- for (uint idx= 0; idx < param->keys; idx++)
+ /* Change all intervals to be "c_{i-1} < X < c_i" */
+ for (uint idx= 0; idx < param->keys; idx++)
+ {
+ SEL_ARG *new_interval, *last_val;
+ if (((new_interval= tree2->keys[idx])) &&
+ ((last_val= tree->keys[idx]->last())))
{
- SEL_ARG *new_interval, *last_val;
- if (((new_interval= tree2->keys[idx])) &&
- ((last_val= tree->keys[idx]->last())))
- {
- new_interval->min_value= last_val->max_value;
- new_interval->min_flag= NEAR_MIN;
- }
+ new_interval->min_value= last_val->max_value;
+ new_interval->min_flag= NEAR_MIN;
}
- /*
- The following doesn't try to allocate memory so no need to
- check for NULL.
- */
- tree= tree_or(param, tree, tree2);
}
+ /*
+ The following doesn't try to allocate memory so no need to
+ check for NULL.
+ */
+ tree= tree_or(param, tree, tree2);
}
}
- else
- func->array->value_to_item(func->array->count - 1, value_item);
if (tree && tree->type != SEL_TREE::IMPOSSIBLE)
{
@@ -5076,7 +5080,119 @@ static SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param, Item_func *cond_func,
}
DBUG_RETURN(tree);
+}
+
+/*
+ Build conjunction of all SEL_TREEs for a simple predicate applying equalities
+
+ SYNOPSIS
+ get_full_func_mm_tree()
+ param PARAM from SQL_SELECT::test_quick_select
+ cond_func item for the predicate
+ field_item field in the predicate
+ value constant in the predicate
+ (for BETWEEN it contains the number of the field argument,
+ for IN it's always 0)
+ inv TRUE <> NOT cond_func is considered
+ (makes sense only when cond_func is BETWEEN or IN)
+
+ DESCRIPTION
+ For a simple SARGable predicate of the form (f op c), where f is a field and
+ c is a constant, the function builds a conjunction of all SEL_TREES that can
+ be obtained by the substitution of f for all different fields equal to f.
+
+ NOTES
+ If the WHERE condition contains a predicate (fi op c),
+ then not only SELL_TREE for this predicate is built, but
+ the trees for the results of substitution of fi for
+ each fj belonging to the same multiple equality as fi
+ are built as well.
+ E.g. for WHERE t1.a=t2.a AND t2.a > 10
+ a SEL_TREE for t2.a > 10 will be built for quick select from t2
+ and
+ a SEL_TREE for t1.a > 10 will be built for quick select from t1.
+
+ A BETWEEN predicate of the form (fi [NOT] BETWEEN c1 AND c2) is treated
+ in a similar way: we build a conjuction of trees for the results
+ of all substitutions of fi for equal fj.
+ Yet a predicate of the form (c BETWEEN f1i AND f2i) is processed
+ differently. It is considered as a conjuction of two SARGable
+ predicates (f1i <= c) and (f2i <=c) and the function get_full_func_mm_tree
+ is called for each of them separately producing trees for
+ AND j (f1j <=c ) and AND j (f2j <= c)
+ After this these two trees are united in one conjunctive tree.
+ It's easy to see that the same tree is obtained for
+ AND j,k (f1j <=c AND f2k<=c)
+ which is equivalent to
+ AND j,k (c BETWEEN f1j AND f2k).
+ The validity of the processing of the predicate (c NOT BETWEEN f1i AND f2i)
+ which equivalent to (f1i > c OR f2i < c) is not so obvious. Here the
+ function get_full_func_mm_tree is called for (f1i > c) and (f2i < c)
+ producing trees for AND j (f1j > c) and AND j (f2j < c). Then this two
+ trees are united in one OR-tree. The expression
+ (AND j (f1j > c) OR AND j (f2j < c)
+ is equivalent to the expression
+ AND j,k (f1j > c OR f2k < c)
+ which is just a translation of
+ AND j,k (c NOT BETWEEN f1j AND f2k)
+
+ In the cases when one of the items f1, f2 is a constant c1 we do not create
+ a tree for it at all. It works for BETWEEN predicates but does not
+ work for NOT BETWEEN predicates as we have to evaluate the expression
+ with it. If it is TRUE then the other tree can be completely ignored.
+ We do not do it now and no trees are built in these cases for
+ NOT BETWEEN predicates.
+
+ As to IN predicates only ones of the form (f IN (c1,...,cn)),
+ where f1 is a field and c1,...,cn are constant, are considered as
+ SARGable. We never try to narrow the index scan using predicates of
+ the form (c IN (c1,...,f,...,cn)).
+
+ RETURN
+ Pointer to the tree representing the built conjunction of SEL_TREEs
+*/
+
+static SEL_TREE *get_full_func_mm_tree(RANGE_OPT_PARAM *param,
+ Item_func *cond_func,
+ Item_field *field_item, Item *value,
+ bool inv)
+{
+ SEL_TREE *tree= 0;
+ SEL_TREE *ftree= 0;
+ table_map ref_tables= 0;
+ table_map param_comp= ~(param->prev_tables | param->read_tables |
+ param->current_table);
+ DBUG_ENTER("get_full_func_mm_tree");
+
+ for (uint i= 0; i < cond_func->arg_count; i++)
+ {
+ Item *arg= cond_func->arguments()[i]->real_item();
+ if (arg != field_item)
+ ref_tables|= arg->used_tables();
+ }
+ Field *field= field_item->field;
+ Item_result cmp_type= field->cmp_type();
+ if (!((ref_tables | field->table->map) & param_comp))
+ ftree= get_func_mm_tree(param, cond_func, field, value, cmp_type, inv);
+ Item_equal *item_equal= field_item->item_equal;
+ if (item_equal)
+ {
+ Item_equal_iterator it(*item_equal);
+ Item_field *item;
+ while ((item= it++))
+ {
+ Field *f= item->field;
+ if (field->eq(f))
+ continue;
+ if (!((ref_tables | f->table->map) & param_comp))
+ {
+ tree= get_func_mm_tree(param, cond_func, f, value, cmp_type, inv);
+ ftree= !ftree ? tree : tree_and(param, ftree, tree);
+ }
+ }
+ }
+ DBUG_RETURN(ftree);
}
/* make a select tree of all keys in condition */
@@ -5087,7 +5203,7 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
SEL_TREE *ftree= 0;
Item_field *field_item= 0;
bool inv= FALSE;
- Item *value;
+ Item *value= 0;
DBUG_ENTER("get_mm_tree");
if (cond->type() == Item::COND_ITEM)
@@ -5167,10 +5283,37 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
switch (cond_func->functype()) {
case Item_func::BETWEEN:
- if (cond_func->arguments()[0]->real_item()->type() != Item::FIELD_ITEM)
- DBUG_RETURN(0);
- field_item= (Item_field*) (cond_func->arguments()[0]->real_item());
- value= NULL;
+ if (cond_func->arguments()[0]->real_item()->type() == Item::FIELD_ITEM)
+ {
+ field_item= (Item_field*) (cond_func->arguments()[0]->real_item());
+ ftree= get_full_func_mm_tree(param, cond_func, field_item, NULL, inv);
+ }
+
+ /*
+ Concerning the code below see the NOTES section in
+ the comments for the function get_full_func_mm_tree()
+ */
+ for (uint i= 1 ; i < cond_func->arg_count ; i++)
+ {
+
+ if (cond_func->arguments()[i]->real_item()->type() == Item::FIELD_ITEM)
+ {
+ field_item= (Item_field*) (cond_func->arguments()[i]->real_item());
+ SEL_TREE *tmp= get_full_func_mm_tree(param, cond_func,
+ field_item, (Item*) i, inv);
+ if (inv)
+ tree= !tree ? tmp : tree_or(param, tree, tmp);
+ else
+ tree= tree_and(param, tree, tmp);
+ }
+ else if (inv)
+ {
+ tree= 0;
+ break;
+ }
+ }
+
+ ftree = tree_and(param, ftree, tree);
break;
case Item_func::IN_FUNC:
{
@@ -5178,7 +5321,7 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
if (func->key_item()->real_item()->type() != Item::FIELD_ITEM)
DBUG_RETURN(0);
field_item= (Item_field*) (func->key_item()->real_item());
- value= NULL;
+ ftree= get_full_func_mm_tree(param, cond_func, field_item, NULL, inv);
break;
}
case Item_func::MULT_EQUAL_FUNC:
@@ -5217,47 +5360,9 @@ static SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param,COND *cond)
}
else
DBUG_RETURN(0);
+ ftree= get_full_func_mm_tree(param, cond_func, field_item, value, inv);
}
- /*
- If the where condition contains a predicate (ti.field op const),
- then not only SELL_TREE for this predicate is built, but
- the trees for the results of substitution of ti.field for
- each tj.field belonging to the same multiple equality as ti.field
- are built as well.
- E.g. for WHERE t1.a=t2.a AND t2.a > 10
- a SEL_TREE for t2.a > 10 will be built for quick select from t2
- and
- a SEL_TREE for t1.a > 10 will be built for quick select from t1.
- */
-
- for (uint i= 0; i < cond_func->arg_count; i++)
- {
- Item *arg= cond_func->arguments()[i]->real_item();
- if (arg != field_item)
- ref_tables|= arg->used_tables();
- }
- Field *field= field_item->field;
- Item_result cmp_type= field->cmp_type();
- if (!((ref_tables | field->table->map) & param_comp))
- ftree= get_func_mm_tree(param, cond_func, field, value, cmp_type, inv);
- Item_equal *item_equal= field_item->item_equal;
- if (item_equal)
- {
- Item_equal_iterator it(*item_equal);
- Item_field *item;
- while ((item= it++))
- {
- Field *f= item->field;
- if (field->eq(f))
- continue;
- if (!((ref_tables | f->table->map) & param_comp))
- {
- tree= get_func_mm_tree(param, cond_func, f, value, cmp_type, inv);
- ftree= !ftree ? tree : tree_and(param, ftree, tree);
- }
- }
- }
DBUG_RETURN(ftree);
}
@@ -7584,16 +7689,10 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
QUICK_RANGE_SELECT* cur_quick;
int result;
Unique *unique;
- MY_BITMAP *save_read_set, *save_write_set;
handler *file= head->file;
DBUG_ENTER("QUICK_INDEX_MERGE_SELECT::read_keys_and_merge");
- /* We're going to just read rowids. */
- save_read_set= head->read_set;
- save_write_set= head->write_set;
file->extra(HA_EXTRA_KEYREAD);
- bitmap_clear_all(&head->tmp_set);
- head->column_bitmaps_set(&head->tmp_set, &head->tmp_set);
head->prepare_for_position();
cur_quick_it.rewind();
@@ -7658,7 +7757,6 @@ int QUICK_INDEX_MERGE_SELECT::read_keys_and_merge()
doing_pk_scan= FALSE;
/* index_merge currently doesn't support "using index" at all */
file->extra(HA_EXTRA_NO_KEYREAD);
- head->column_bitmaps_set(save_read_set, save_write_set);
/* start table scan */
init_read_record(&read_record, thd, head, (SQL_SELECT*) 0, 1, 1);
DBUG_RETURN(result);
diff --git a/sql/set_var.cc b/sql/set_var.cc
index de418dba735..bc2f0e0d823 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -3467,7 +3467,7 @@ int set_var_user::check(THD *thd)
0 can be passed as last argument (reference on item)
*/
return (user_var_item->fix_fields(thd, (Item**) 0) ||
- user_var_item->check()) ? -1 : 0;
+ user_var_item->check(0)) ? -1 : 0;
}
diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt
index 24306f38c7d..2228ded870b 100644
--- a/sql/share/errmsg.txt
+++ b/sql/share/errmsg.txt
@@ -5702,9 +5702,7 @@ ER_BLOB_FIELD_IN_PART_FUNC_ERROR
ger "In der Partitionierungsfunktion sind BLOB-Spalten nicht erlaubt"
swe "Ett BLOB-fält är inte tillåtet i partitioneringsfunktioner"
ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
- eng "A %-.64s need to include all fields in the partition function"
- ger "Ein %-.64s muss alle Spalten der Partitionierungsfunktion umfassen"
- swe "En %-.64s behöver inkludera alla fält i partitioneringsfunktionen för denna lagringsmotor"
+ eng "A %-.64s must include all columns in the table's partitioning function"
ER_NO_PARTS_ERROR
eng "Number of %-.64s = 0 is not an allowed value"
ger "Eine Anzahl von %-.64s = 0 ist kein erlaubter Wert"
@@ -5954,6 +5952,8 @@ ER_BAD_LOG_ENGINE
eng "One can use only CSV and MyISAM engines for the log tables"
ER_CANT_DROP_LOG_TABLE
eng "Cannot drop log table if log is enabled"
+ER_ONLY_INTEGERS_ALLOWED
+ eng "Only normal integers allowed as number here"
ER_USERNAME
eng "user name"
ER_HOSTNAME
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index c7776db324b..2395ba66399 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -1006,6 +1006,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
sql_print_information("X509 issuer mismatch: should be '%s' "
"but is '%s'", acl_user->x509_issuer, ptr);
free(ptr);
+ user_access=NO_ACCESS;
break;
}
user_access= acl_user->access;
@@ -1021,11 +1022,13 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (strcmp(acl_user->x509_subject,ptr))
{
if (global_system_variables.log_warnings)
- sql_print_information("X509 subject mismatch: '%s' vs '%s'",
+ sql_print_information("X509 subject mismatch: should be '%s' but is '%s'",
acl_user->x509_subject, ptr);
+ free(ptr);
+ user_access=NO_ACCESS;
+ break;
}
- else
- user_access= acl_user->access;
+ user_access= acl_user->access;
free(ptr);
}
break;
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 32a622c7401..7e5acb6d9aa 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -5482,9 +5482,11 @@ bool setup_tables_and_check_access(THD *thd,
TABLE_LIST *tables,
TABLE_LIST **leaves,
bool select_insert,
+ ulong want_access_first,
ulong want_access)
{
TABLE_LIST *leaves_tmp= NULL;
+ bool first_table= true;
if (setup_tables(thd, context, from_clause, tables,
&leaves_tmp, select_insert))
@@ -5495,11 +5497,13 @@ bool setup_tables_and_check_access(THD *thd,
for (; leaves_tmp; leaves_tmp= leaves_tmp->next_leaf)
{
if (leaves_tmp->belong_to_view &&
- check_single_table_access(thd, want_access, leaves_tmp))
+ check_single_table_access(thd, first_table ? want_access_first :
+ want_access, leaves_tmp))
{
tables->hide_view_error(thd);
return TRUE;
}
+ first_table= 0;
}
return FALSE;
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 72051b2b29d..3fc182e20f3 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1983,7 +1983,7 @@ bool select_dumpvar::send_data(List<Item> &items)
{
if ((xx=li++))
{
- xx->check();
+ xx->check(0);
xx->update();
}
}
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 56beea24b87..4c91ba6d8ff 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -383,7 +383,7 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
&thd->lex->select_lex.top_join_list,
table_list,
&select_lex->leaf_tables, FALSE,
- DELETE_ACL) ||
+ DELETE_ACL, SELECT_ACL) ||
setup_conds(thd, table_list, select_lex->leaf_tables, conds) ||
setup_ftfuncs(select_lex))
DBUG_RETURN(TRUE);
@@ -446,7 +446,7 @@ bool mysql_multi_delete_prepare(THD *thd)
&thd->lex->select_lex.top_join_list,
lex->query_tables,
&lex->select_lex.leaf_tables, FALSE,
- DELETE_ACL))
+ DELETE_ACL, SELECT_ACL))
DBUG_RETURN(TRUE);
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 5df6b1832f5..4ae368cc0e4 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -821,7 +821,7 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
&thd->lex->select_lex.top_join_list,
table_list,
&thd->lex->select_lex.leaf_tables,
- select_insert, SELECT_ACL))
+ select_insert, INSERT_ACL, SELECT_ACL))
DBUG_RETURN(TRUE);
if (insert_into_view && !fields.elements)
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 25cb7ff4c1e..7e93fa28980 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -156,6 +156,7 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
&thd->lex->select_lex.top_join_list,
table_list,
&thd->lex->select_lex.leaf_tables, FALSE,
+ INSERT_ACL | UPDATE_ACL,
INSERT_ACL | UPDATE_ACL))
DBUG_RETURN(-1);
if (!table_list->table || // do not suport join view
diff --git a/sql/sql_locale.cc b/sql/sql_locale.cc
index 9dae55e4508..b947b9dfa98 100644
--- a/sql/sql_locale.cc
+++ b/sql/sql_locale.cc
@@ -52,8 +52,7 @@ static TYPELIB my_locale_typelib_day_names_ar_AE =
{ array_elements(my_locale_day_names_ar_AE)-1, "", my_locale_day_names_ar_AE, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ar_AE =
{ array_elements(my_locale_ab_day_names_ar_AE)-1, "", my_locale_ab_day_names_ar_AE, NULL };
-MY_LOCALE my_locale_ar_AE=
- { "ar_AE", "Arabic - United Arab Emirates", FALSE, &my_locale_typelib_month_names_ar_AE, &my_locale_typelib_ab_month_names_ar_AE, &my_locale_typelib_day_names_ar_AE, &my_locale_typelib_ab_day_names_ar_AE };
+MY_LOCALE my_locale_ar_AE ( "ar_AE", "Arabic - United Arab Emirates", FALSE, &my_locale_typelib_month_names_ar_AE, &my_locale_typelib_ab_month_names_ar_AE, &my_locale_typelib_day_names_ar_AE, &my_locale_typelib_ab_day_names_ar_AE );
/***** LOCALE END ar_AE *****/
/***** LOCALE BEGIN ar_BH: Arabic - Bahrain *****/
@@ -73,8 +72,7 @@ static TYPELIB my_locale_typelib_day_names_ar_BH =
{ array_elements(my_locale_day_names_ar_BH)-1, "", my_locale_day_names_ar_BH, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ar_BH =
{ array_elements(my_locale_ab_day_names_ar_BH)-1, "", my_locale_ab_day_names_ar_BH, NULL };
-MY_LOCALE my_locale_ar_BH=
- { "ar_BH", "Arabic - Bahrain", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_BH ( "ar_BH", "Arabic - Bahrain", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_BH *****/
/***** LOCALE BEGIN ar_JO: Arabic - Jordan *****/
@@ -94,8 +92,7 @@ static TYPELIB my_locale_typelib_day_names_ar_JO =
{ array_elements(my_locale_day_names_ar_JO)-1, "", my_locale_day_names_ar_JO, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ar_JO =
{ array_elements(my_locale_ab_day_names_ar_JO)-1, "", my_locale_ab_day_names_ar_JO, NULL };
-MY_LOCALE my_locale_ar_JO=
- { "ar_JO", "Arabic - Jordan", FALSE, &my_locale_typelib_month_names_ar_JO, &my_locale_typelib_ab_month_names_ar_JO, &my_locale_typelib_day_names_ar_JO, &my_locale_typelib_ab_day_names_ar_JO };
+MY_LOCALE my_locale_ar_JO ( "ar_JO", "Arabic - Jordan", FALSE, &my_locale_typelib_month_names_ar_JO, &my_locale_typelib_ab_month_names_ar_JO, &my_locale_typelib_day_names_ar_JO, &my_locale_typelib_ab_day_names_ar_JO );
/***** LOCALE END ar_JO *****/
/***** LOCALE BEGIN ar_SA: Arabic - Saudi Arabia *****/
@@ -115,8 +112,7 @@ static TYPELIB my_locale_typelib_day_names_ar_SA =
{ array_elements(my_locale_day_names_ar_SA)-1, "", my_locale_day_names_ar_SA, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ar_SA =
{ array_elements(my_locale_ab_day_names_ar_SA)-1, "", my_locale_ab_day_names_ar_SA, NULL };
-MY_LOCALE my_locale_ar_SA=
- { "ar_SA", "Arabic - Saudi Arabia", FALSE, &my_locale_typelib_month_names_ar_SA, &my_locale_typelib_ab_month_names_ar_SA, &my_locale_typelib_day_names_ar_SA, &my_locale_typelib_ab_day_names_ar_SA };
+MY_LOCALE my_locale_ar_SA ( "ar_SA", "Arabic - Saudi Arabia", FALSE, &my_locale_typelib_month_names_ar_SA, &my_locale_typelib_ab_month_names_ar_SA, &my_locale_typelib_day_names_ar_SA, &my_locale_typelib_ab_day_names_ar_SA );
/***** LOCALE END ar_SA *****/
/***** LOCALE BEGIN ar_SY: Arabic - Syria *****/
@@ -136,8 +132,7 @@ static TYPELIB my_locale_typelib_day_names_ar_SY =
{ array_elements(my_locale_day_names_ar_SY)-1, "", my_locale_day_names_ar_SY, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ar_SY =
{ array_elements(my_locale_ab_day_names_ar_SY)-1, "", my_locale_ab_day_names_ar_SY, NULL };
-MY_LOCALE my_locale_ar_SY=
- { "ar_SY", "Arabic - Syria", FALSE, &my_locale_typelib_month_names_ar_SY, &my_locale_typelib_ab_month_names_ar_SY, &my_locale_typelib_day_names_ar_SY, &my_locale_typelib_ab_day_names_ar_SY };
+MY_LOCALE my_locale_ar_SY ( "ar_SY", "Arabic - Syria", FALSE, &my_locale_typelib_month_names_ar_SY, &my_locale_typelib_ab_month_names_ar_SY, &my_locale_typelib_day_names_ar_SY, &my_locale_typelib_ab_day_names_ar_SY );
/***** LOCALE END ar_SY *****/
/***** LOCALE BEGIN be_BY: Belarusian - Belarus *****/
@@ -157,8 +152,7 @@ static TYPELIB my_locale_typelib_day_names_be_BY =
{ array_elements(my_locale_day_names_be_BY)-1, "", my_locale_day_names_be_BY, NULL };
static TYPELIB my_locale_typelib_ab_day_names_be_BY =
{ array_elements(my_locale_ab_day_names_be_BY)-1, "", my_locale_ab_day_names_be_BY, NULL };
-MY_LOCALE my_locale_be_BY=
- { "be_BY", "Belarusian - Belarus", FALSE, &my_locale_typelib_month_names_be_BY, &my_locale_typelib_ab_month_names_be_BY, &my_locale_typelib_day_names_be_BY, &my_locale_typelib_ab_day_names_be_BY };
+MY_LOCALE my_locale_be_BY ( "be_BY", "Belarusian - Belarus", FALSE, &my_locale_typelib_month_names_be_BY, &my_locale_typelib_ab_month_names_be_BY, &my_locale_typelib_day_names_be_BY, &my_locale_typelib_ab_day_names_be_BY );
/***** LOCALE END be_BY *****/
/***** LOCALE BEGIN bg_BG: Bulgarian - Bulgaria *****/
@@ -178,8 +172,7 @@ static TYPELIB my_locale_typelib_day_names_bg_BG =
{ array_elements(my_locale_day_names_bg_BG)-1, "", my_locale_day_names_bg_BG, NULL };
static TYPELIB my_locale_typelib_ab_day_names_bg_BG =
{ array_elements(my_locale_ab_day_names_bg_BG)-1, "", my_locale_ab_day_names_bg_BG, NULL };
-MY_LOCALE my_locale_bg_BG=
- { "bg_BG", "Bulgarian - Bulgaria", FALSE, &my_locale_typelib_month_names_bg_BG, &my_locale_typelib_ab_month_names_bg_BG, &my_locale_typelib_day_names_bg_BG, &my_locale_typelib_ab_day_names_bg_BG };
+MY_LOCALE my_locale_bg_BG ( "bg_BG", "Bulgarian - Bulgaria", FALSE, &my_locale_typelib_month_names_bg_BG, &my_locale_typelib_ab_month_names_bg_BG, &my_locale_typelib_day_names_bg_BG, &my_locale_typelib_ab_day_names_bg_BG );
/***** LOCALE END bg_BG *****/
/***** LOCALE BEGIN ca_ES: Catalan - Catalan *****/
@@ -199,8 +192,7 @@ static TYPELIB my_locale_typelib_day_names_ca_ES =
{ array_elements(my_locale_day_names_ca_ES)-1, "", my_locale_day_names_ca_ES, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ca_ES =
{ array_elements(my_locale_ab_day_names_ca_ES)-1, "", my_locale_ab_day_names_ca_ES, NULL };
-MY_LOCALE my_locale_ca_ES=
- { "ca_ES", "Catalan - Catalan", FALSE, &my_locale_typelib_month_names_ca_ES, &my_locale_typelib_ab_month_names_ca_ES, &my_locale_typelib_day_names_ca_ES, &my_locale_typelib_ab_day_names_ca_ES };
+MY_LOCALE my_locale_ca_ES ( "ca_ES", "Catalan - Catalan", FALSE, &my_locale_typelib_month_names_ca_ES, &my_locale_typelib_ab_month_names_ca_ES, &my_locale_typelib_day_names_ca_ES, &my_locale_typelib_ab_day_names_ca_ES );
/***** LOCALE END ca_ES *****/
/***** LOCALE BEGIN cs_CZ: Czech - Czech Republic *****/
@@ -220,8 +212,7 @@ static TYPELIB my_locale_typelib_day_names_cs_CZ =
{ array_elements(my_locale_day_names_cs_CZ)-1, "", my_locale_day_names_cs_CZ, NULL };
static TYPELIB my_locale_typelib_ab_day_names_cs_CZ =
{ array_elements(my_locale_ab_day_names_cs_CZ)-1, "", my_locale_ab_day_names_cs_CZ, NULL };
-MY_LOCALE my_locale_cs_CZ=
- { "cs_CZ", "Czech - Czech Republic", FALSE, &my_locale_typelib_month_names_cs_CZ, &my_locale_typelib_ab_month_names_cs_CZ, &my_locale_typelib_day_names_cs_CZ, &my_locale_typelib_ab_day_names_cs_CZ };
+MY_LOCALE my_locale_cs_CZ ( "cs_CZ", "Czech - Czech Republic", FALSE, &my_locale_typelib_month_names_cs_CZ, &my_locale_typelib_ab_month_names_cs_CZ, &my_locale_typelib_day_names_cs_CZ, &my_locale_typelib_ab_day_names_cs_CZ );
/***** LOCALE END cs_CZ *****/
/***** LOCALE BEGIN da_DK: Danish - Denmark *****/
@@ -241,8 +232,7 @@ static TYPELIB my_locale_typelib_day_names_da_DK =
{ array_elements(my_locale_day_names_da_DK)-1, "", my_locale_day_names_da_DK, NULL };
static TYPELIB my_locale_typelib_ab_day_names_da_DK =
{ array_elements(my_locale_ab_day_names_da_DK)-1, "", my_locale_ab_day_names_da_DK, NULL };
-MY_LOCALE my_locale_da_DK=
- { "da_DK", "Danish - Denmark", FALSE, &my_locale_typelib_month_names_da_DK, &my_locale_typelib_ab_month_names_da_DK, &my_locale_typelib_day_names_da_DK, &my_locale_typelib_ab_day_names_da_DK };
+MY_LOCALE my_locale_da_DK ( "da_DK", "Danish - Denmark", FALSE, &my_locale_typelib_month_names_da_DK, &my_locale_typelib_ab_month_names_da_DK, &my_locale_typelib_day_names_da_DK, &my_locale_typelib_ab_day_names_da_DK );
/***** LOCALE END da_DK *****/
/***** LOCALE BEGIN de_AT: German - Austria *****/
@@ -262,8 +252,7 @@ static TYPELIB my_locale_typelib_day_names_de_AT =
{ array_elements(my_locale_day_names_de_AT)-1, "", my_locale_day_names_de_AT, NULL };
static TYPELIB my_locale_typelib_ab_day_names_de_AT =
{ array_elements(my_locale_ab_day_names_de_AT)-1, "", my_locale_ab_day_names_de_AT, NULL };
-MY_LOCALE my_locale_de_AT=
- { "de_AT", "German - Austria", FALSE, &my_locale_typelib_month_names_de_AT, &my_locale_typelib_ab_month_names_de_AT, &my_locale_typelib_day_names_de_AT, &my_locale_typelib_ab_day_names_de_AT };
+MY_LOCALE my_locale_de_AT ( "de_AT", "German - Austria", FALSE, &my_locale_typelib_month_names_de_AT, &my_locale_typelib_ab_month_names_de_AT, &my_locale_typelib_day_names_de_AT, &my_locale_typelib_ab_day_names_de_AT );
/***** LOCALE END de_AT *****/
/***** LOCALE BEGIN de_DE: German - Germany *****/
@@ -283,8 +272,7 @@ static TYPELIB my_locale_typelib_day_names_de_DE =
{ array_elements(my_locale_day_names_de_DE)-1, "", my_locale_day_names_de_DE, NULL };
static TYPELIB my_locale_typelib_ab_day_names_de_DE =
{ array_elements(my_locale_ab_day_names_de_DE)-1, "", my_locale_ab_day_names_de_DE, NULL };
-MY_LOCALE my_locale_de_DE=
- { "de_DE", "German - Germany", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE };
+MY_LOCALE my_locale_de_DE ( "de_DE", "German - Germany", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE );
/***** LOCALE END de_DE *****/
/***** LOCALE BEGIN en_US: English - United States *****/
@@ -304,8 +292,7 @@ static TYPELIB my_locale_typelib_day_names_en_US =
{ array_elements(my_locale_day_names_en_US)-1, "", my_locale_day_names_en_US, NULL };
static TYPELIB my_locale_typelib_ab_day_names_en_US =
{ array_elements(my_locale_ab_day_names_en_US)-1, "", my_locale_ab_day_names_en_US, NULL };
-MY_LOCALE my_locale_en_US=
- { "en_US", "English - United States", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_US ( "en_US", "English - United States", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_US *****/
/***** LOCALE BEGIN es_ES: Spanish - Spain *****/
@@ -325,8 +312,7 @@ static TYPELIB my_locale_typelib_day_names_es_ES =
{ array_elements(my_locale_day_names_es_ES)-1, "", my_locale_day_names_es_ES, NULL };
static TYPELIB my_locale_typelib_ab_day_names_es_ES =
{ array_elements(my_locale_ab_day_names_es_ES)-1, "", my_locale_ab_day_names_es_ES, NULL };
-MY_LOCALE my_locale_es_ES=
- { "es_ES", "Spanish - Spain", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_ES ( "es_ES", "Spanish - Spain", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_ES *****/
/***** LOCALE BEGIN et_EE: Estonian - Estonia *****/
@@ -346,8 +332,7 @@ static TYPELIB my_locale_typelib_day_names_et_EE =
{ array_elements(my_locale_day_names_et_EE)-1, "", my_locale_day_names_et_EE, NULL };
static TYPELIB my_locale_typelib_ab_day_names_et_EE =
{ array_elements(my_locale_ab_day_names_et_EE)-1, "", my_locale_ab_day_names_et_EE, NULL };
-MY_LOCALE my_locale_et_EE=
- { "et_EE", "Estonian - Estonia", FALSE, &my_locale_typelib_month_names_et_EE, &my_locale_typelib_ab_month_names_et_EE, &my_locale_typelib_day_names_et_EE, &my_locale_typelib_ab_day_names_et_EE };
+MY_LOCALE my_locale_et_EE ( "et_EE", "Estonian - Estonia", FALSE, &my_locale_typelib_month_names_et_EE, &my_locale_typelib_ab_month_names_et_EE, &my_locale_typelib_day_names_et_EE, &my_locale_typelib_ab_day_names_et_EE );
/***** LOCALE END et_EE *****/
/***** LOCALE BEGIN eu_ES: Basque - Basque *****/
@@ -367,8 +352,7 @@ static TYPELIB my_locale_typelib_day_names_eu_ES =
{ array_elements(my_locale_day_names_eu_ES)-1, "", my_locale_day_names_eu_ES, NULL };
static TYPELIB my_locale_typelib_ab_day_names_eu_ES =
{ array_elements(my_locale_ab_day_names_eu_ES)-1, "", my_locale_ab_day_names_eu_ES, NULL };
-MY_LOCALE my_locale_eu_ES=
- { "eu_ES", "Basque - Basque", TRUE, &my_locale_typelib_month_names_eu_ES, &my_locale_typelib_ab_month_names_eu_ES, &my_locale_typelib_day_names_eu_ES, &my_locale_typelib_ab_day_names_eu_ES };
+MY_LOCALE my_locale_eu_ES ( "eu_ES", "Basque - Basque", TRUE, &my_locale_typelib_month_names_eu_ES, &my_locale_typelib_ab_month_names_eu_ES, &my_locale_typelib_day_names_eu_ES, &my_locale_typelib_ab_day_names_eu_ES );
/***** LOCALE END eu_ES *****/
/***** LOCALE BEGIN fi_FI: Finnish - Finland *****/
@@ -388,8 +372,7 @@ static TYPELIB my_locale_typelib_day_names_fi_FI =
{ array_elements(my_locale_day_names_fi_FI)-1, "", my_locale_day_names_fi_FI, NULL };
static TYPELIB my_locale_typelib_ab_day_names_fi_FI =
{ array_elements(my_locale_ab_day_names_fi_FI)-1, "", my_locale_ab_day_names_fi_FI, NULL };
-MY_LOCALE my_locale_fi_FI=
- { "fi_FI", "Finnish - Finland", FALSE, &my_locale_typelib_month_names_fi_FI, &my_locale_typelib_ab_month_names_fi_FI, &my_locale_typelib_day_names_fi_FI, &my_locale_typelib_ab_day_names_fi_FI };
+MY_LOCALE my_locale_fi_FI ( "fi_FI", "Finnish - Finland", FALSE, &my_locale_typelib_month_names_fi_FI, &my_locale_typelib_ab_month_names_fi_FI, &my_locale_typelib_day_names_fi_FI, &my_locale_typelib_ab_day_names_fi_FI );
/***** LOCALE END fi_FI *****/
/***** LOCALE BEGIN fo_FO: Faroese - Faroe Islands *****/
@@ -409,8 +392,7 @@ static TYPELIB my_locale_typelib_day_names_fo_FO =
{ array_elements(my_locale_day_names_fo_FO)-1, "", my_locale_day_names_fo_FO, NULL };
static TYPELIB my_locale_typelib_ab_day_names_fo_FO =
{ array_elements(my_locale_ab_day_names_fo_FO)-1, "", my_locale_ab_day_names_fo_FO, NULL };
-MY_LOCALE my_locale_fo_FO=
- { "fo_FO", "Faroese - Faroe Islands", FALSE, &my_locale_typelib_month_names_fo_FO, &my_locale_typelib_ab_month_names_fo_FO, &my_locale_typelib_day_names_fo_FO, &my_locale_typelib_ab_day_names_fo_FO };
+MY_LOCALE my_locale_fo_FO ( "fo_FO", "Faroese - Faroe Islands", FALSE, &my_locale_typelib_month_names_fo_FO, &my_locale_typelib_ab_month_names_fo_FO, &my_locale_typelib_day_names_fo_FO, &my_locale_typelib_ab_day_names_fo_FO );
/***** LOCALE END fo_FO *****/
/***** LOCALE BEGIN fr_FR: French - France *****/
@@ -430,8 +412,7 @@ static TYPELIB my_locale_typelib_day_names_fr_FR =
{ array_elements(my_locale_day_names_fr_FR)-1, "", my_locale_day_names_fr_FR, NULL };
static TYPELIB my_locale_typelib_ab_day_names_fr_FR =
{ array_elements(my_locale_ab_day_names_fr_FR)-1, "", my_locale_ab_day_names_fr_FR, NULL };
-MY_LOCALE my_locale_fr_FR=
- { "fr_FR", "French - France", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR };
+MY_LOCALE my_locale_fr_FR ( "fr_FR", "French - France", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR );
/***** LOCALE END fr_FR *****/
/***** LOCALE BEGIN gl_ES: Galician - Galician *****/
@@ -451,8 +432,7 @@ static TYPELIB my_locale_typelib_day_names_gl_ES =
{ array_elements(my_locale_day_names_gl_ES)-1, "", my_locale_day_names_gl_ES, NULL };
static TYPELIB my_locale_typelib_ab_day_names_gl_ES =
{ array_elements(my_locale_ab_day_names_gl_ES)-1, "", my_locale_ab_day_names_gl_ES, NULL };
-MY_LOCALE my_locale_gl_ES=
- { "gl_ES", "Galician - Galician", FALSE, &my_locale_typelib_month_names_gl_ES, &my_locale_typelib_ab_month_names_gl_ES, &my_locale_typelib_day_names_gl_ES, &my_locale_typelib_ab_day_names_gl_ES };
+MY_LOCALE my_locale_gl_ES ( "gl_ES", "Galician - Galician", FALSE, &my_locale_typelib_month_names_gl_ES, &my_locale_typelib_ab_month_names_gl_ES, &my_locale_typelib_day_names_gl_ES, &my_locale_typelib_ab_day_names_gl_ES );
/***** LOCALE END gl_ES *****/
/***** LOCALE BEGIN gu_IN: Gujarati - India *****/
@@ -472,8 +452,7 @@ static TYPELIB my_locale_typelib_day_names_gu_IN =
{ array_elements(my_locale_day_names_gu_IN)-1, "", my_locale_day_names_gu_IN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_gu_IN =
{ array_elements(my_locale_ab_day_names_gu_IN)-1, "", my_locale_ab_day_names_gu_IN, NULL };
-MY_LOCALE my_locale_gu_IN=
- { "gu_IN", "Gujarati - India", FALSE, &my_locale_typelib_month_names_gu_IN, &my_locale_typelib_ab_month_names_gu_IN, &my_locale_typelib_day_names_gu_IN, &my_locale_typelib_ab_day_names_gu_IN };
+MY_LOCALE my_locale_gu_IN ( "gu_IN", "Gujarati - India", FALSE, &my_locale_typelib_month_names_gu_IN, &my_locale_typelib_ab_month_names_gu_IN, &my_locale_typelib_day_names_gu_IN, &my_locale_typelib_ab_day_names_gu_IN );
/***** LOCALE END gu_IN *****/
/***** LOCALE BEGIN he_IL: Hebrew - Israel *****/
@@ -493,8 +472,7 @@ static TYPELIB my_locale_typelib_day_names_he_IL =
{ array_elements(my_locale_day_names_he_IL)-1, "", my_locale_day_names_he_IL, NULL };
static TYPELIB my_locale_typelib_ab_day_names_he_IL =
{ array_elements(my_locale_ab_day_names_he_IL)-1, "", my_locale_ab_day_names_he_IL, NULL };
-MY_LOCALE my_locale_he_IL=
- { "he_IL", "Hebrew - Israel", FALSE, &my_locale_typelib_month_names_he_IL, &my_locale_typelib_ab_month_names_he_IL, &my_locale_typelib_day_names_he_IL, &my_locale_typelib_ab_day_names_he_IL };
+MY_LOCALE my_locale_he_IL ( "he_IL", "Hebrew - Israel", FALSE, &my_locale_typelib_month_names_he_IL, &my_locale_typelib_ab_month_names_he_IL, &my_locale_typelib_day_names_he_IL, &my_locale_typelib_ab_day_names_he_IL );
/***** LOCALE END he_IL *****/
/***** LOCALE BEGIN hi_IN: Hindi - India *****/
@@ -514,8 +492,7 @@ static TYPELIB my_locale_typelib_day_names_hi_IN =
{ array_elements(my_locale_day_names_hi_IN)-1, "", my_locale_day_names_hi_IN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_hi_IN =
{ array_elements(my_locale_ab_day_names_hi_IN)-1, "", my_locale_ab_day_names_hi_IN, NULL };
-MY_LOCALE my_locale_hi_IN=
- { "hi_IN", "Hindi - India", FALSE, &my_locale_typelib_month_names_hi_IN, &my_locale_typelib_ab_month_names_hi_IN, &my_locale_typelib_day_names_hi_IN, &my_locale_typelib_ab_day_names_hi_IN };
+MY_LOCALE my_locale_hi_IN ( "hi_IN", "Hindi - India", FALSE, &my_locale_typelib_month_names_hi_IN, &my_locale_typelib_ab_month_names_hi_IN, &my_locale_typelib_day_names_hi_IN, &my_locale_typelib_ab_day_names_hi_IN );
/***** LOCALE END hi_IN *****/
/***** LOCALE BEGIN hr_HR: Croatian - Croatia *****/
@@ -535,8 +512,7 @@ static TYPELIB my_locale_typelib_day_names_hr_HR =
{ array_elements(my_locale_day_names_hr_HR)-1, "", my_locale_day_names_hr_HR, NULL };
static TYPELIB my_locale_typelib_ab_day_names_hr_HR =
{ array_elements(my_locale_ab_day_names_hr_HR)-1, "", my_locale_ab_day_names_hr_HR, NULL };
-MY_LOCALE my_locale_hr_HR=
- { "hr_HR", "Croatian - Croatia", FALSE, &my_locale_typelib_month_names_hr_HR, &my_locale_typelib_ab_month_names_hr_HR, &my_locale_typelib_day_names_hr_HR, &my_locale_typelib_ab_day_names_hr_HR };
+MY_LOCALE my_locale_hr_HR ( "hr_HR", "Croatian - Croatia", FALSE, &my_locale_typelib_month_names_hr_HR, &my_locale_typelib_ab_month_names_hr_HR, &my_locale_typelib_day_names_hr_HR, &my_locale_typelib_ab_day_names_hr_HR );
/***** LOCALE END hr_HR *****/
/***** LOCALE BEGIN hu_HU: Hungarian - Hungary *****/
@@ -556,8 +532,7 @@ static TYPELIB my_locale_typelib_day_names_hu_HU =
{ array_elements(my_locale_day_names_hu_HU)-1, "", my_locale_day_names_hu_HU, NULL };
static TYPELIB my_locale_typelib_ab_day_names_hu_HU =
{ array_elements(my_locale_ab_day_names_hu_HU)-1, "", my_locale_ab_day_names_hu_HU, NULL };
-MY_LOCALE my_locale_hu_HU=
- { "hu_HU", "Hungarian - Hungary", FALSE, &my_locale_typelib_month_names_hu_HU, &my_locale_typelib_ab_month_names_hu_HU, &my_locale_typelib_day_names_hu_HU, &my_locale_typelib_ab_day_names_hu_HU };
+MY_LOCALE my_locale_hu_HU ( "hu_HU", "Hungarian - Hungary", FALSE, &my_locale_typelib_month_names_hu_HU, &my_locale_typelib_ab_month_names_hu_HU, &my_locale_typelib_day_names_hu_HU, &my_locale_typelib_ab_day_names_hu_HU );
/***** LOCALE END hu_HU *****/
/***** LOCALE BEGIN id_ID: Indonesian - Indonesia *****/
@@ -577,8 +552,7 @@ static TYPELIB my_locale_typelib_day_names_id_ID =
{ array_elements(my_locale_day_names_id_ID)-1, "", my_locale_day_names_id_ID, NULL };
static TYPELIB my_locale_typelib_ab_day_names_id_ID =
{ array_elements(my_locale_ab_day_names_id_ID)-1, "", my_locale_ab_day_names_id_ID, NULL };
-MY_LOCALE my_locale_id_ID=
- { "id_ID", "Indonesian - Indonesia", TRUE, &my_locale_typelib_month_names_id_ID, &my_locale_typelib_ab_month_names_id_ID, &my_locale_typelib_day_names_id_ID, &my_locale_typelib_ab_day_names_id_ID };
+MY_LOCALE my_locale_id_ID ( "id_ID", "Indonesian - Indonesia", TRUE, &my_locale_typelib_month_names_id_ID, &my_locale_typelib_ab_month_names_id_ID, &my_locale_typelib_day_names_id_ID, &my_locale_typelib_ab_day_names_id_ID );
/***** LOCALE END id_ID *****/
/***** LOCALE BEGIN is_IS: Icelandic - Iceland *****/
@@ -598,8 +572,7 @@ static TYPELIB my_locale_typelib_day_names_is_IS =
{ array_elements(my_locale_day_names_is_IS)-1, "", my_locale_day_names_is_IS, NULL };
static TYPELIB my_locale_typelib_ab_day_names_is_IS =
{ array_elements(my_locale_ab_day_names_is_IS)-1, "", my_locale_ab_day_names_is_IS, NULL };
-MY_LOCALE my_locale_is_IS=
- { "is_IS", "Icelandic - Iceland", FALSE, &my_locale_typelib_month_names_is_IS, &my_locale_typelib_ab_month_names_is_IS, &my_locale_typelib_day_names_is_IS, &my_locale_typelib_ab_day_names_is_IS };
+MY_LOCALE my_locale_is_IS ( "is_IS", "Icelandic - Iceland", FALSE, &my_locale_typelib_month_names_is_IS, &my_locale_typelib_ab_month_names_is_IS, &my_locale_typelib_day_names_is_IS, &my_locale_typelib_ab_day_names_is_IS );
/***** LOCALE END is_IS *****/
/***** LOCALE BEGIN it_CH: Italian - Switzerland *****/
@@ -619,8 +592,7 @@ static TYPELIB my_locale_typelib_day_names_it_CH =
{ array_elements(my_locale_day_names_it_CH)-1, "", my_locale_day_names_it_CH, NULL };
static TYPELIB my_locale_typelib_ab_day_names_it_CH =
{ array_elements(my_locale_ab_day_names_it_CH)-1, "", my_locale_ab_day_names_it_CH, NULL };
-MY_LOCALE my_locale_it_CH=
- { "it_CH", "Italian - Switzerland", FALSE, &my_locale_typelib_month_names_it_CH, &my_locale_typelib_ab_month_names_it_CH, &my_locale_typelib_day_names_it_CH, &my_locale_typelib_ab_day_names_it_CH };
+MY_LOCALE my_locale_it_CH ( "it_CH", "Italian - Switzerland", FALSE, &my_locale_typelib_month_names_it_CH, &my_locale_typelib_ab_month_names_it_CH, &my_locale_typelib_day_names_it_CH, &my_locale_typelib_ab_day_names_it_CH );
/***** LOCALE END it_CH *****/
/***** LOCALE BEGIN ja_JP: Japanese - Japan *****/
@@ -640,8 +612,7 @@ static TYPELIB my_locale_typelib_day_names_ja_JP =
{ array_elements(my_locale_day_names_ja_JP)-1, "", my_locale_day_names_ja_JP, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ja_JP =
{ array_elements(my_locale_ab_day_names_ja_JP)-1, "", my_locale_ab_day_names_ja_JP, NULL };
-MY_LOCALE my_locale_ja_JP=
- { "ja_JP", "Japanese - Japan", FALSE, &my_locale_typelib_month_names_ja_JP, &my_locale_typelib_ab_month_names_ja_JP, &my_locale_typelib_day_names_ja_JP, &my_locale_typelib_ab_day_names_ja_JP };
+MY_LOCALE my_locale_ja_JP ( "ja_JP", "Japanese - Japan", FALSE, &my_locale_typelib_month_names_ja_JP, &my_locale_typelib_ab_month_names_ja_JP, &my_locale_typelib_day_names_ja_JP, &my_locale_typelib_ab_day_names_ja_JP );
/***** LOCALE END ja_JP *****/
/***** LOCALE BEGIN ko_KR: Korean - Korea *****/
@@ -661,8 +632,7 @@ static TYPELIB my_locale_typelib_day_names_ko_KR =
{ array_elements(my_locale_day_names_ko_KR)-1, "", my_locale_day_names_ko_KR, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ko_KR =
{ array_elements(my_locale_ab_day_names_ko_KR)-1, "", my_locale_ab_day_names_ko_KR, NULL };
-MY_LOCALE my_locale_ko_KR=
- { "ko_KR", "Korean - Korea", FALSE, &my_locale_typelib_month_names_ko_KR, &my_locale_typelib_ab_month_names_ko_KR, &my_locale_typelib_day_names_ko_KR, &my_locale_typelib_ab_day_names_ko_KR };
+MY_LOCALE my_locale_ko_KR ( "ko_KR", "Korean - Korea", FALSE, &my_locale_typelib_month_names_ko_KR, &my_locale_typelib_ab_month_names_ko_KR, &my_locale_typelib_day_names_ko_KR, &my_locale_typelib_ab_day_names_ko_KR );
/***** LOCALE END ko_KR *****/
/***** LOCALE BEGIN lt_LT: Lithuanian - Lithuania *****/
@@ -682,8 +652,7 @@ static TYPELIB my_locale_typelib_day_names_lt_LT =
{ array_elements(my_locale_day_names_lt_LT)-1, "", my_locale_day_names_lt_LT, NULL };
static TYPELIB my_locale_typelib_ab_day_names_lt_LT =
{ array_elements(my_locale_ab_day_names_lt_LT)-1, "", my_locale_ab_day_names_lt_LT, NULL };
-MY_LOCALE my_locale_lt_LT=
- { "lt_LT", "Lithuanian - Lithuania", FALSE, &my_locale_typelib_month_names_lt_LT, &my_locale_typelib_ab_month_names_lt_LT, &my_locale_typelib_day_names_lt_LT, &my_locale_typelib_ab_day_names_lt_LT };
+MY_LOCALE my_locale_lt_LT ( "lt_LT", "Lithuanian - Lithuania", FALSE, &my_locale_typelib_month_names_lt_LT, &my_locale_typelib_ab_month_names_lt_LT, &my_locale_typelib_day_names_lt_LT, &my_locale_typelib_ab_day_names_lt_LT );
/***** LOCALE END lt_LT *****/
/***** LOCALE BEGIN lv_LV: Latvian - Latvia *****/
@@ -703,8 +672,7 @@ static TYPELIB my_locale_typelib_day_names_lv_LV =
{ array_elements(my_locale_day_names_lv_LV)-1, "", my_locale_day_names_lv_LV, NULL };
static TYPELIB my_locale_typelib_ab_day_names_lv_LV =
{ array_elements(my_locale_ab_day_names_lv_LV)-1, "", my_locale_ab_day_names_lv_LV, NULL };
-MY_LOCALE my_locale_lv_LV=
- { "lv_LV", "Latvian - Latvia", FALSE, &my_locale_typelib_month_names_lv_LV, &my_locale_typelib_ab_month_names_lv_LV, &my_locale_typelib_day_names_lv_LV, &my_locale_typelib_ab_day_names_lv_LV };
+MY_LOCALE my_locale_lv_LV ( "lv_LV", "Latvian - Latvia", FALSE, &my_locale_typelib_month_names_lv_LV, &my_locale_typelib_ab_month_names_lv_LV, &my_locale_typelib_day_names_lv_LV, &my_locale_typelib_ab_day_names_lv_LV );
/***** LOCALE END lv_LV *****/
/***** LOCALE BEGIN mk_MK: Macedonian - FYROM *****/
@@ -724,8 +692,7 @@ static TYPELIB my_locale_typelib_day_names_mk_MK =
{ array_elements(my_locale_day_names_mk_MK)-1, "", my_locale_day_names_mk_MK, NULL };
static TYPELIB my_locale_typelib_ab_day_names_mk_MK =
{ array_elements(my_locale_ab_day_names_mk_MK)-1, "", my_locale_ab_day_names_mk_MK, NULL };
-MY_LOCALE my_locale_mk_MK=
- { "mk_MK", "Macedonian - FYROM", FALSE, &my_locale_typelib_month_names_mk_MK, &my_locale_typelib_ab_month_names_mk_MK, &my_locale_typelib_day_names_mk_MK, &my_locale_typelib_ab_day_names_mk_MK };
+MY_LOCALE my_locale_mk_MK ( "mk_MK", "Macedonian - FYROM", FALSE, &my_locale_typelib_month_names_mk_MK, &my_locale_typelib_ab_month_names_mk_MK, &my_locale_typelib_day_names_mk_MK, &my_locale_typelib_ab_day_names_mk_MK );
/***** LOCALE END mk_MK *****/
/***** LOCALE BEGIN mn_MN: Mongolia - Mongolian *****/
@@ -745,8 +712,7 @@ static TYPELIB my_locale_typelib_day_names_mn_MN =
{ array_elements(my_locale_day_names_mn_MN)-1, "", my_locale_day_names_mn_MN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_mn_MN =
{ array_elements(my_locale_ab_day_names_mn_MN)-1, "", my_locale_ab_day_names_mn_MN, NULL };
-MY_LOCALE my_locale_mn_MN=
- { "mn_MN", "Mongolia - Mongolian", FALSE, &my_locale_typelib_month_names_mn_MN, &my_locale_typelib_ab_month_names_mn_MN, &my_locale_typelib_day_names_mn_MN, &my_locale_typelib_ab_day_names_mn_MN };
+MY_LOCALE my_locale_mn_MN ( "mn_MN", "Mongolia - Mongolian", FALSE, &my_locale_typelib_month_names_mn_MN, &my_locale_typelib_ab_month_names_mn_MN, &my_locale_typelib_day_names_mn_MN, &my_locale_typelib_ab_day_names_mn_MN );
/***** LOCALE END mn_MN *****/
/***** LOCALE BEGIN ms_MY: Malay - Malaysia *****/
@@ -766,8 +732,7 @@ static TYPELIB my_locale_typelib_day_names_ms_MY =
{ array_elements(my_locale_day_names_ms_MY)-1, "", my_locale_day_names_ms_MY, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ms_MY =
{ array_elements(my_locale_ab_day_names_ms_MY)-1, "", my_locale_ab_day_names_ms_MY, NULL };
-MY_LOCALE my_locale_ms_MY=
- { "ms_MY", "Malay - Malaysia", TRUE, &my_locale_typelib_month_names_ms_MY, &my_locale_typelib_ab_month_names_ms_MY, &my_locale_typelib_day_names_ms_MY, &my_locale_typelib_ab_day_names_ms_MY };
+MY_LOCALE my_locale_ms_MY ( "ms_MY", "Malay - Malaysia", TRUE, &my_locale_typelib_month_names_ms_MY, &my_locale_typelib_ab_month_names_ms_MY, &my_locale_typelib_day_names_ms_MY, &my_locale_typelib_ab_day_names_ms_MY );
/***** LOCALE END ms_MY *****/
/***** LOCALE BEGIN nb_NO: Norwegian(Bokml) - Norway *****/
@@ -787,8 +752,7 @@ static TYPELIB my_locale_typelib_day_names_nb_NO =
{ array_elements(my_locale_day_names_nb_NO)-1, "", my_locale_day_names_nb_NO, NULL };
static TYPELIB my_locale_typelib_ab_day_names_nb_NO =
{ array_elements(my_locale_ab_day_names_nb_NO)-1, "", my_locale_ab_day_names_nb_NO, NULL };
-MY_LOCALE my_locale_nb_NO=
- { "nb_NO", "Norwegian(Bokml) - Norway", FALSE, &my_locale_typelib_month_names_nb_NO, &my_locale_typelib_ab_month_names_nb_NO, &my_locale_typelib_day_names_nb_NO, &my_locale_typelib_ab_day_names_nb_NO };
+MY_LOCALE my_locale_nb_NO ( "nb_NO", "Norwegian(Bokml) - Norway", FALSE, &my_locale_typelib_month_names_nb_NO, &my_locale_typelib_ab_month_names_nb_NO, &my_locale_typelib_day_names_nb_NO, &my_locale_typelib_ab_day_names_nb_NO );
/***** LOCALE END nb_NO *****/
/***** LOCALE BEGIN nl_NL: Dutch - The Netherlands *****/
@@ -808,8 +772,7 @@ static TYPELIB my_locale_typelib_day_names_nl_NL =
{ array_elements(my_locale_day_names_nl_NL)-1, "", my_locale_day_names_nl_NL, NULL };
static TYPELIB my_locale_typelib_ab_day_names_nl_NL =
{ array_elements(my_locale_ab_day_names_nl_NL)-1, "", my_locale_ab_day_names_nl_NL, NULL };
-MY_LOCALE my_locale_nl_NL=
- { "nl_NL", "Dutch - The Netherlands", TRUE, &my_locale_typelib_month_names_nl_NL, &my_locale_typelib_ab_month_names_nl_NL, &my_locale_typelib_day_names_nl_NL, &my_locale_typelib_ab_day_names_nl_NL };
+MY_LOCALE my_locale_nl_NL ( "nl_NL", "Dutch - The Netherlands", TRUE, &my_locale_typelib_month_names_nl_NL, &my_locale_typelib_ab_month_names_nl_NL, &my_locale_typelib_day_names_nl_NL, &my_locale_typelib_ab_day_names_nl_NL );
/***** LOCALE END nl_NL *****/
/***** LOCALE BEGIN pl_PL: Polish - Poland *****/
@@ -829,8 +792,7 @@ static TYPELIB my_locale_typelib_day_names_pl_PL =
{ array_elements(my_locale_day_names_pl_PL)-1, "", my_locale_day_names_pl_PL, NULL };
static TYPELIB my_locale_typelib_ab_day_names_pl_PL =
{ array_elements(my_locale_ab_day_names_pl_PL)-1, "", my_locale_ab_day_names_pl_PL, NULL };
-MY_LOCALE my_locale_pl_PL=
- { "pl_PL", "Polish - Poland", FALSE, &my_locale_typelib_month_names_pl_PL, &my_locale_typelib_ab_month_names_pl_PL, &my_locale_typelib_day_names_pl_PL, &my_locale_typelib_ab_day_names_pl_PL };
+MY_LOCALE my_locale_pl_PL ( "pl_PL", "Polish - Poland", FALSE, &my_locale_typelib_month_names_pl_PL, &my_locale_typelib_ab_month_names_pl_PL, &my_locale_typelib_day_names_pl_PL, &my_locale_typelib_ab_day_names_pl_PL );
/***** LOCALE END pl_PL *****/
/***** LOCALE BEGIN pt_BR: Portugese - Brazil *****/
@@ -850,8 +812,7 @@ static TYPELIB my_locale_typelib_day_names_pt_BR =
{ array_elements(my_locale_day_names_pt_BR)-1, "", my_locale_day_names_pt_BR, NULL };
static TYPELIB my_locale_typelib_ab_day_names_pt_BR =
{ array_elements(my_locale_ab_day_names_pt_BR)-1, "", my_locale_ab_day_names_pt_BR, NULL };
-MY_LOCALE my_locale_pt_BR=
- { "pt_BR", "Portugese - Brazil", FALSE, &my_locale_typelib_month_names_pt_BR, &my_locale_typelib_ab_month_names_pt_BR, &my_locale_typelib_day_names_pt_BR, &my_locale_typelib_ab_day_names_pt_BR };
+MY_LOCALE my_locale_pt_BR ( "pt_BR", "Portugese - Brazil", FALSE, &my_locale_typelib_month_names_pt_BR, &my_locale_typelib_ab_month_names_pt_BR, &my_locale_typelib_day_names_pt_BR, &my_locale_typelib_ab_day_names_pt_BR );
/***** LOCALE END pt_BR *****/
/***** LOCALE BEGIN pt_PT: Portugese - Portugal *****/
@@ -871,8 +832,7 @@ static TYPELIB my_locale_typelib_day_names_pt_PT =
{ array_elements(my_locale_day_names_pt_PT)-1, "", my_locale_day_names_pt_PT, NULL };
static TYPELIB my_locale_typelib_ab_day_names_pt_PT =
{ array_elements(my_locale_ab_day_names_pt_PT)-1, "", my_locale_ab_day_names_pt_PT, NULL };
-MY_LOCALE my_locale_pt_PT=
- { "pt_PT", "Portugese - Portugal", FALSE, &my_locale_typelib_month_names_pt_PT, &my_locale_typelib_ab_month_names_pt_PT, &my_locale_typelib_day_names_pt_PT, &my_locale_typelib_ab_day_names_pt_PT };
+MY_LOCALE my_locale_pt_PT ( "pt_PT", "Portugese - Portugal", FALSE, &my_locale_typelib_month_names_pt_PT, &my_locale_typelib_ab_month_names_pt_PT, &my_locale_typelib_day_names_pt_PT, &my_locale_typelib_ab_day_names_pt_PT );
/***** LOCALE END pt_PT *****/
/***** LOCALE BEGIN ro_RO: Romanian - Romania *****/
@@ -892,8 +852,7 @@ static TYPELIB my_locale_typelib_day_names_ro_RO =
{ array_elements(my_locale_day_names_ro_RO)-1, "", my_locale_day_names_ro_RO, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ro_RO =
{ array_elements(my_locale_ab_day_names_ro_RO)-1, "", my_locale_ab_day_names_ro_RO, NULL };
-MY_LOCALE my_locale_ro_RO=
- { "ro_RO", "Romanian - Romania", FALSE, &my_locale_typelib_month_names_ro_RO, &my_locale_typelib_ab_month_names_ro_RO, &my_locale_typelib_day_names_ro_RO, &my_locale_typelib_ab_day_names_ro_RO };
+MY_LOCALE my_locale_ro_RO ( "ro_RO", "Romanian - Romania", FALSE, &my_locale_typelib_month_names_ro_RO, &my_locale_typelib_ab_month_names_ro_RO, &my_locale_typelib_day_names_ro_RO, &my_locale_typelib_ab_day_names_ro_RO );
/***** LOCALE END ro_RO *****/
/***** LOCALE BEGIN ru_RU: Russian - Russia *****/
@@ -913,8 +872,7 @@ static TYPELIB my_locale_typelib_day_names_ru_RU =
{ array_elements(my_locale_day_names_ru_RU)-1, "", my_locale_day_names_ru_RU, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ru_RU =
{ array_elements(my_locale_ab_day_names_ru_RU)-1, "", my_locale_ab_day_names_ru_RU, NULL };
-MY_LOCALE my_locale_ru_RU=
- { "ru_RU", "Russian - Russia", FALSE, &my_locale_typelib_month_names_ru_RU, &my_locale_typelib_ab_month_names_ru_RU, &my_locale_typelib_day_names_ru_RU, &my_locale_typelib_ab_day_names_ru_RU };
+MY_LOCALE my_locale_ru_RU ( "ru_RU", "Russian - Russia", FALSE, &my_locale_typelib_month_names_ru_RU, &my_locale_typelib_ab_month_names_ru_RU, &my_locale_typelib_day_names_ru_RU, &my_locale_typelib_ab_day_names_ru_RU );
/***** LOCALE END ru_RU *****/
/***** LOCALE BEGIN ru_UA: Russian - Ukraine *****/
@@ -934,8 +892,7 @@ static TYPELIB my_locale_typelib_day_names_ru_UA =
{ array_elements(my_locale_day_names_ru_UA)-1, "", my_locale_day_names_ru_UA, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ru_UA =
{ array_elements(my_locale_ab_day_names_ru_UA)-1, "", my_locale_ab_day_names_ru_UA, NULL };
-MY_LOCALE my_locale_ru_UA=
- { "ru_UA", "Russian - Ukraine", FALSE, &my_locale_typelib_month_names_ru_UA, &my_locale_typelib_ab_month_names_ru_UA, &my_locale_typelib_day_names_ru_UA, &my_locale_typelib_ab_day_names_ru_UA };
+MY_LOCALE my_locale_ru_UA ( "ru_UA", "Russian - Ukraine", FALSE, &my_locale_typelib_month_names_ru_UA, &my_locale_typelib_ab_month_names_ru_UA, &my_locale_typelib_day_names_ru_UA, &my_locale_typelib_ab_day_names_ru_UA );
/***** LOCALE END ru_UA *****/
/***** LOCALE BEGIN sk_SK: Slovak - Slovakia *****/
@@ -955,8 +912,7 @@ static TYPELIB my_locale_typelib_day_names_sk_SK =
{ array_elements(my_locale_day_names_sk_SK)-1, "", my_locale_day_names_sk_SK, NULL };
static TYPELIB my_locale_typelib_ab_day_names_sk_SK =
{ array_elements(my_locale_ab_day_names_sk_SK)-1, "", my_locale_ab_day_names_sk_SK, NULL };
-MY_LOCALE my_locale_sk_SK=
- { "sk_SK", "Slovak - Slovakia", FALSE, &my_locale_typelib_month_names_sk_SK, &my_locale_typelib_ab_month_names_sk_SK, &my_locale_typelib_day_names_sk_SK, &my_locale_typelib_ab_day_names_sk_SK };
+MY_LOCALE my_locale_sk_SK ( "sk_SK", "Slovak - Slovakia", FALSE, &my_locale_typelib_month_names_sk_SK, &my_locale_typelib_ab_month_names_sk_SK, &my_locale_typelib_day_names_sk_SK, &my_locale_typelib_ab_day_names_sk_SK );
/***** LOCALE END sk_SK *****/
/***** LOCALE BEGIN sl_SI: Slovenian - Slovenia *****/
@@ -976,8 +932,7 @@ static TYPELIB my_locale_typelib_day_names_sl_SI =
{ array_elements(my_locale_day_names_sl_SI)-1, "", my_locale_day_names_sl_SI, NULL };
static TYPELIB my_locale_typelib_ab_day_names_sl_SI =
{ array_elements(my_locale_ab_day_names_sl_SI)-1, "", my_locale_ab_day_names_sl_SI, NULL };
-MY_LOCALE my_locale_sl_SI=
- { "sl_SI", "Slovenian - Slovenia", FALSE, &my_locale_typelib_month_names_sl_SI, &my_locale_typelib_ab_month_names_sl_SI, &my_locale_typelib_day_names_sl_SI, &my_locale_typelib_ab_day_names_sl_SI };
+MY_LOCALE my_locale_sl_SI ( "sl_SI", "Slovenian - Slovenia", FALSE, &my_locale_typelib_month_names_sl_SI, &my_locale_typelib_ab_month_names_sl_SI, &my_locale_typelib_day_names_sl_SI, &my_locale_typelib_ab_day_names_sl_SI );
/***** LOCALE END sl_SI *****/
/***** LOCALE BEGIN sq_AL: Albanian - Albania *****/
@@ -997,8 +952,7 @@ static TYPELIB my_locale_typelib_day_names_sq_AL =
{ array_elements(my_locale_day_names_sq_AL)-1, "", my_locale_day_names_sq_AL, NULL };
static TYPELIB my_locale_typelib_ab_day_names_sq_AL =
{ array_elements(my_locale_ab_day_names_sq_AL)-1, "", my_locale_ab_day_names_sq_AL, NULL };
-MY_LOCALE my_locale_sq_AL=
- { "sq_AL", "Albanian - Albania", FALSE, &my_locale_typelib_month_names_sq_AL, &my_locale_typelib_ab_month_names_sq_AL, &my_locale_typelib_day_names_sq_AL, &my_locale_typelib_ab_day_names_sq_AL };
+MY_LOCALE my_locale_sq_AL ( "sq_AL", "Albanian - Albania", FALSE, &my_locale_typelib_month_names_sq_AL, &my_locale_typelib_ab_month_names_sq_AL, &my_locale_typelib_day_names_sq_AL, &my_locale_typelib_ab_day_names_sq_AL );
/***** LOCALE END sq_AL *****/
/***** LOCALE BEGIN sr_YU: Servian - Yugoslavia *****/
@@ -1018,8 +972,7 @@ static TYPELIB my_locale_typelib_day_names_sr_YU =
{ array_elements(my_locale_day_names_sr_YU)-1, "", my_locale_day_names_sr_YU, NULL };
static TYPELIB my_locale_typelib_ab_day_names_sr_YU =
{ array_elements(my_locale_ab_day_names_sr_YU)-1, "", my_locale_ab_day_names_sr_YU, NULL };
-MY_LOCALE my_locale_sr_YU=
- { "sr_YU", "Servian - Yugoslavia", FALSE, &my_locale_typelib_month_names_sr_YU, &my_locale_typelib_ab_month_names_sr_YU, &my_locale_typelib_day_names_sr_YU, &my_locale_typelib_ab_day_names_sr_YU };
+MY_LOCALE my_locale_sr_YU ( "sr_YU", "Servian - Yugoslavia", FALSE, &my_locale_typelib_month_names_sr_YU, &my_locale_typelib_ab_month_names_sr_YU, &my_locale_typelib_day_names_sr_YU, &my_locale_typelib_ab_day_names_sr_YU );
/***** LOCALE END sr_YU *****/
/***** LOCALE BEGIN sv_SE: Swedish - Sweden *****/
@@ -1039,8 +992,7 @@ static TYPELIB my_locale_typelib_day_names_sv_SE =
{ array_elements(my_locale_day_names_sv_SE)-1, "", my_locale_day_names_sv_SE, NULL };
static TYPELIB my_locale_typelib_ab_day_names_sv_SE =
{ array_elements(my_locale_ab_day_names_sv_SE)-1, "", my_locale_ab_day_names_sv_SE, NULL };
-MY_LOCALE my_locale_sv_SE=
- { "sv_SE", "Swedish - Sweden", FALSE, &my_locale_typelib_month_names_sv_SE, &my_locale_typelib_ab_month_names_sv_SE, &my_locale_typelib_day_names_sv_SE, &my_locale_typelib_ab_day_names_sv_SE };
+MY_LOCALE my_locale_sv_SE ( "sv_SE", "Swedish - Sweden", FALSE, &my_locale_typelib_month_names_sv_SE, &my_locale_typelib_ab_month_names_sv_SE, &my_locale_typelib_day_names_sv_SE, &my_locale_typelib_ab_day_names_sv_SE );
/***** LOCALE END sv_SE *****/
/***** LOCALE BEGIN ta_IN: Tamil - India *****/
@@ -1060,8 +1012,7 @@ static TYPELIB my_locale_typelib_day_names_ta_IN =
{ array_elements(my_locale_day_names_ta_IN)-1, "", my_locale_day_names_ta_IN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ta_IN =
{ array_elements(my_locale_ab_day_names_ta_IN)-1, "", my_locale_ab_day_names_ta_IN, NULL };
-MY_LOCALE my_locale_ta_IN=
- { "ta_IN", "Tamil - India", FALSE, &my_locale_typelib_month_names_ta_IN, &my_locale_typelib_ab_month_names_ta_IN, &my_locale_typelib_day_names_ta_IN, &my_locale_typelib_ab_day_names_ta_IN };
+MY_LOCALE my_locale_ta_IN ( "ta_IN", "Tamil - India", FALSE, &my_locale_typelib_month_names_ta_IN, &my_locale_typelib_ab_month_names_ta_IN, &my_locale_typelib_day_names_ta_IN, &my_locale_typelib_ab_day_names_ta_IN );
/***** LOCALE END ta_IN *****/
/***** LOCALE BEGIN te_IN: Telugu - India *****/
@@ -1081,8 +1032,7 @@ static TYPELIB my_locale_typelib_day_names_te_IN =
{ array_elements(my_locale_day_names_te_IN)-1, "", my_locale_day_names_te_IN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_te_IN =
{ array_elements(my_locale_ab_day_names_te_IN)-1, "", my_locale_ab_day_names_te_IN, NULL };
-MY_LOCALE my_locale_te_IN=
- { "te_IN", "Telugu - India", FALSE, &my_locale_typelib_month_names_te_IN, &my_locale_typelib_ab_month_names_te_IN, &my_locale_typelib_day_names_te_IN, &my_locale_typelib_ab_day_names_te_IN };
+MY_LOCALE my_locale_te_IN ( "te_IN", "Telugu - India", FALSE, &my_locale_typelib_month_names_te_IN, &my_locale_typelib_ab_month_names_te_IN, &my_locale_typelib_day_names_te_IN, &my_locale_typelib_ab_day_names_te_IN );
/***** LOCALE END te_IN *****/
/***** LOCALE BEGIN th_TH: Thai - Thailand *****/
@@ -1102,8 +1052,7 @@ static TYPELIB my_locale_typelib_day_names_th_TH =
{ array_elements(my_locale_day_names_th_TH)-1, "", my_locale_day_names_th_TH, NULL };
static TYPELIB my_locale_typelib_ab_day_names_th_TH =
{ array_elements(my_locale_ab_day_names_th_TH)-1, "", my_locale_ab_day_names_th_TH, NULL };
-MY_LOCALE my_locale_th_TH=
- { "th_TH", "Thai - Thailand", FALSE, &my_locale_typelib_month_names_th_TH, &my_locale_typelib_ab_month_names_th_TH, &my_locale_typelib_day_names_th_TH, &my_locale_typelib_ab_day_names_th_TH };
+MY_LOCALE my_locale_th_TH ( "th_TH", "Thai - Thailand", FALSE, &my_locale_typelib_month_names_th_TH, &my_locale_typelib_ab_month_names_th_TH, &my_locale_typelib_day_names_th_TH, &my_locale_typelib_ab_day_names_th_TH );
/***** LOCALE END th_TH *****/
/***** LOCALE BEGIN tr_TR: Turkish - Turkey *****/
@@ -1123,8 +1072,7 @@ static TYPELIB my_locale_typelib_day_names_tr_TR =
{ array_elements(my_locale_day_names_tr_TR)-1, "", my_locale_day_names_tr_TR, NULL };
static TYPELIB my_locale_typelib_ab_day_names_tr_TR =
{ array_elements(my_locale_ab_day_names_tr_TR)-1, "", my_locale_ab_day_names_tr_TR, NULL };
-MY_LOCALE my_locale_tr_TR=
- { "tr_TR", "Turkish - Turkey", FALSE, &my_locale_typelib_month_names_tr_TR, &my_locale_typelib_ab_month_names_tr_TR, &my_locale_typelib_day_names_tr_TR, &my_locale_typelib_ab_day_names_tr_TR };
+MY_LOCALE my_locale_tr_TR ( "tr_TR", "Turkish - Turkey", FALSE, &my_locale_typelib_month_names_tr_TR, &my_locale_typelib_ab_month_names_tr_TR, &my_locale_typelib_day_names_tr_TR, &my_locale_typelib_ab_day_names_tr_TR );
/***** LOCALE END tr_TR *****/
/***** LOCALE BEGIN uk_UA: Ukrainian - Ukraine *****/
@@ -1144,8 +1092,7 @@ static TYPELIB my_locale_typelib_day_names_uk_UA =
{ array_elements(my_locale_day_names_uk_UA)-1, "", my_locale_day_names_uk_UA, NULL };
static TYPELIB my_locale_typelib_ab_day_names_uk_UA =
{ array_elements(my_locale_ab_day_names_uk_UA)-1, "", my_locale_ab_day_names_uk_UA, NULL };
-MY_LOCALE my_locale_uk_UA=
- { "uk_UA", "Ukrainian - Ukraine", FALSE, &my_locale_typelib_month_names_uk_UA, &my_locale_typelib_ab_month_names_uk_UA, &my_locale_typelib_day_names_uk_UA, &my_locale_typelib_ab_day_names_uk_UA };
+MY_LOCALE my_locale_uk_UA ( "uk_UA", "Ukrainian - Ukraine", FALSE, &my_locale_typelib_month_names_uk_UA, &my_locale_typelib_ab_month_names_uk_UA, &my_locale_typelib_day_names_uk_UA, &my_locale_typelib_ab_day_names_uk_UA );
/***** LOCALE END uk_UA *****/
/***** LOCALE BEGIN ur_PK: Urdu - Pakistan *****/
@@ -1165,8 +1112,7 @@ static TYPELIB my_locale_typelib_day_names_ur_PK =
{ array_elements(my_locale_day_names_ur_PK)-1, "", my_locale_day_names_ur_PK, NULL };
static TYPELIB my_locale_typelib_ab_day_names_ur_PK =
{ array_elements(my_locale_ab_day_names_ur_PK)-1, "", my_locale_ab_day_names_ur_PK, NULL };
-MY_LOCALE my_locale_ur_PK=
- { "ur_PK", "Urdu - Pakistan", FALSE, &my_locale_typelib_month_names_ur_PK, &my_locale_typelib_ab_month_names_ur_PK, &my_locale_typelib_day_names_ur_PK, &my_locale_typelib_ab_day_names_ur_PK };
+MY_LOCALE my_locale_ur_PK ( "ur_PK", "Urdu - Pakistan", FALSE, &my_locale_typelib_month_names_ur_PK, &my_locale_typelib_ab_month_names_ur_PK, &my_locale_typelib_day_names_ur_PK, &my_locale_typelib_ab_day_names_ur_PK );
/***** LOCALE END ur_PK *****/
/***** LOCALE BEGIN vi_VN: Vietnamese - Vietnam *****/
@@ -1186,8 +1132,7 @@ static TYPELIB my_locale_typelib_day_names_vi_VN =
{ array_elements(my_locale_day_names_vi_VN)-1, "", my_locale_day_names_vi_VN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_vi_VN =
{ array_elements(my_locale_ab_day_names_vi_VN)-1, "", my_locale_ab_day_names_vi_VN, NULL };
-MY_LOCALE my_locale_vi_VN=
- { "vi_VN", "Vietnamese - Vietnam", FALSE, &my_locale_typelib_month_names_vi_VN, &my_locale_typelib_ab_month_names_vi_VN, &my_locale_typelib_day_names_vi_VN, &my_locale_typelib_ab_day_names_vi_VN };
+MY_LOCALE my_locale_vi_VN ( "vi_VN", "Vietnamese - Vietnam", FALSE, &my_locale_typelib_month_names_vi_VN, &my_locale_typelib_ab_month_names_vi_VN, &my_locale_typelib_day_names_vi_VN, &my_locale_typelib_ab_day_names_vi_VN );
/***** LOCALE END vi_VN *****/
/***** LOCALE BEGIN zh_CN: Chinese - Peoples Republic of China *****/
@@ -1207,8 +1152,7 @@ static TYPELIB my_locale_typelib_day_names_zh_CN =
{ array_elements(my_locale_day_names_zh_CN)-1, "", my_locale_day_names_zh_CN, NULL };
static TYPELIB my_locale_typelib_ab_day_names_zh_CN =
{ array_elements(my_locale_ab_day_names_zh_CN)-1, "", my_locale_ab_day_names_zh_CN, NULL };
-MY_LOCALE my_locale_zh_CN=
- { "zh_CN", "Chinese - Peoples Republic of China", FALSE, &my_locale_typelib_month_names_zh_CN, &my_locale_typelib_ab_month_names_zh_CN, &my_locale_typelib_day_names_zh_CN, &my_locale_typelib_ab_day_names_zh_CN };
+MY_LOCALE my_locale_zh_CN ( "zh_CN", "Chinese - Peoples Republic of China", FALSE, &my_locale_typelib_month_names_zh_CN, &my_locale_typelib_ab_month_names_zh_CN, &my_locale_typelib_day_names_zh_CN, &my_locale_typelib_ab_day_names_zh_CN );
/***** LOCALE END zh_CN *****/
/***** LOCALE BEGIN zh_TW: Chinese - Taiwan *****/
@@ -1228,268 +1172,215 @@ static TYPELIB my_locale_typelib_day_names_zh_TW =
{ array_elements(my_locale_day_names_zh_TW)-1, "", my_locale_day_names_zh_TW, NULL };
static TYPELIB my_locale_typelib_ab_day_names_zh_TW =
{ array_elements(my_locale_ab_day_names_zh_TW)-1, "", my_locale_ab_day_names_zh_TW, NULL };
-MY_LOCALE my_locale_zh_TW=
- { "zh_TW", "Chinese - Taiwan", FALSE, &my_locale_typelib_month_names_zh_TW, &my_locale_typelib_ab_month_names_zh_TW, &my_locale_typelib_day_names_zh_TW, &my_locale_typelib_ab_day_names_zh_TW };
+MY_LOCALE my_locale_zh_TW ( "zh_TW", "Chinese - Taiwan", FALSE, &my_locale_typelib_month_names_zh_TW, &my_locale_typelib_ab_month_names_zh_TW, &my_locale_typelib_day_names_zh_TW, &my_locale_typelib_ab_day_names_zh_TW );
/***** LOCALE END zh_TW *****/
/***** LOCALE BEGIN ar_DZ: Arabic - Algeria *****/
-MY_LOCALE my_locale_ar_DZ=
- { "ar_DZ", "Arabic - Algeria", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_DZ ( "ar_DZ", "Arabic - Algeria", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_DZ *****/
/***** LOCALE BEGIN ar_EG: Arabic - Egypt *****/
-MY_LOCALE my_locale_ar_EG=
- { "ar_EG", "Arabic - Egypt", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_EG ( "ar_EG", "Arabic - Egypt", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_EG *****/
/***** LOCALE BEGIN ar_IN: Arabic - Iran *****/
-MY_LOCALE my_locale_ar_IN=
- { "ar_IN", "Arabic - Iran", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_IN ( "ar_IN", "Arabic - Iran", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_IN *****/
/***** LOCALE BEGIN ar_IQ: Arabic - Iraq *****/
-MY_LOCALE my_locale_ar_IQ=
- { "ar_IQ", "Arabic - Iraq", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_IQ ( "ar_IQ", "Arabic - Iraq", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_IQ *****/
/***** LOCALE BEGIN ar_KW: Arabic - Kuwait *****/
-MY_LOCALE my_locale_ar_KW=
- { "ar_KW", "Arabic - Kuwait", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_KW ( "ar_KW", "Arabic - Kuwait", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_KW *****/
/***** LOCALE BEGIN ar_LB: Arabic - Lebanon *****/
-MY_LOCALE my_locale_ar_LB=
- { "ar_LB", "Arabic - Lebanon", FALSE, &my_locale_typelib_month_names_ar_JO, &my_locale_typelib_ab_month_names_ar_JO, &my_locale_typelib_day_names_ar_JO, &my_locale_typelib_ab_day_names_ar_JO };
+MY_LOCALE my_locale_ar_LB ( "ar_LB", "Arabic - Lebanon", FALSE, &my_locale_typelib_month_names_ar_JO, &my_locale_typelib_ab_month_names_ar_JO, &my_locale_typelib_day_names_ar_JO, &my_locale_typelib_ab_day_names_ar_JO );
/***** LOCALE END ar_LB *****/
/***** LOCALE BEGIN ar_LY: Arabic - Libya *****/
-MY_LOCALE my_locale_ar_LY=
- { "ar_LY", "Arabic - Libya", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_LY ( "ar_LY", "Arabic - Libya", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_LY *****/
/***** LOCALE BEGIN ar_MA: Arabic - Morocco *****/
-MY_LOCALE my_locale_ar_MA=
- { "ar_MA", "Arabic - Morocco", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_MA ( "ar_MA", "Arabic - Morocco", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_MA *****/
/***** LOCALE BEGIN ar_OM: Arabic - Oman *****/
-MY_LOCALE my_locale_ar_OM=
- { "ar_OM", "Arabic - Oman", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_OM ( "ar_OM", "Arabic - Oman", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_OM *****/
/***** LOCALE BEGIN ar_QA: Arabic - Qatar *****/
-MY_LOCALE my_locale_ar_QA=
- { "ar_QA", "Arabic - Qatar", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_QA ( "ar_QA", "Arabic - Qatar", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_QA *****/
/***** LOCALE BEGIN ar_SD: Arabic - Sudan *****/
-MY_LOCALE my_locale_ar_SD=
- { "ar_SD", "Arabic - Sudan", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_SD ( "ar_SD", "Arabic - Sudan", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_SD *****/
/***** LOCALE BEGIN ar_TN: Arabic - Tunisia *****/
-MY_LOCALE my_locale_ar_TN=
- { "ar_TN", "Arabic - Tunisia", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_TN ( "ar_TN", "Arabic - Tunisia", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_TN *****/
/***** LOCALE BEGIN ar_YE: Arabic - Yemen *****/
-MY_LOCALE my_locale_ar_YE=
- { "ar_YE", "Arabic - Yemen", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH };
+MY_LOCALE my_locale_ar_YE ( "ar_YE", "Arabic - Yemen", FALSE, &my_locale_typelib_month_names_ar_BH, &my_locale_typelib_ab_month_names_ar_BH, &my_locale_typelib_day_names_ar_BH, &my_locale_typelib_ab_day_names_ar_BH );
/***** LOCALE END ar_YE *****/
/***** LOCALE BEGIN de_BE: German - Belgium *****/
-MY_LOCALE my_locale_de_BE=
- { "de_BE", "German - Belgium", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE };
+MY_LOCALE my_locale_de_BE ( "de_BE", "German - Belgium", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE );
/***** LOCALE END de_BE *****/
/***** LOCALE BEGIN de_CH: German - Switzerland *****/
-MY_LOCALE my_locale_de_CH=
- { "de_CH", "German - Switzerland", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE };
+MY_LOCALE my_locale_de_CH ( "de_CH", "German - Switzerland", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE );
/***** LOCALE END de_CH *****/
/***** LOCALE BEGIN de_LU: German - Luxembourg *****/
-MY_LOCALE my_locale_de_LU=
- { "de_LU", "German - Luxembourg", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE };
+MY_LOCALE my_locale_de_LU ( "de_LU", "German - Luxembourg", FALSE, &my_locale_typelib_month_names_de_DE, &my_locale_typelib_ab_month_names_de_DE, &my_locale_typelib_day_names_de_DE, &my_locale_typelib_ab_day_names_de_DE );
/***** LOCALE END de_LU *****/
/***** LOCALE BEGIN en_AU: English - Australia *****/
-MY_LOCALE my_locale_en_AU=
- { "en_AU", "English - Australia", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_AU ( "en_AU", "English - Australia", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_AU *****/
/***** LOCALE BEGIN en_CA: English - Canada *****/
-MY_LOCALE my_locale_en_CA=
- { "en_CA", "English - Canada", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_CA ( "en_CA", "English - Canada", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_CA *****/
/***** LOCALE BEGIN en_GB: English - United Kingdom *****/
-MY_LOCALE my_locale_en_GB=
- { "en_GB", "English - United Kingdom", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_GB ( "en_GB", "English - United Kingdom", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_GB *****/
/***** LOCALE BEGIN en_IN: English - India *****/
-MY_LOCALE my_locale_en_IN=
- { "en_IN", "English - India", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_IN ( "en_IN", "English - India", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_IN *****/
/***** LOCALE BEGIN en_NZ: English - New Zealand *****/
-MY_LOCALE my_locale_en_NZ=
- { "en_NZ", "English - New Zealand", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_NZ ( "en_NZ", "English - New Zealand", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_NZ *****/
/***** LOCALE BEGIN en_PH: English - Philippines *****/
-MY_LOCALE my_locale_en_PH=
- { "en_PH", "English - Philippines", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_PH ( "en_PH", "English - Philippines", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_PH *****/
/***** LOCALE BEGIN en_ZA: English - South Africa *****/
-MY_LOCALE my_locale_en_ZA=
- { "en_ZA", "English - South Africa", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_ZA ( "en_ZA", "English - South Africa", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_ZA *****/
/***** LOCALE BEGIN en_ZW: English - Zimbabwe *****/
-MY_LOCALE my_locale_en_ZW=
- { "en_ZW", "English - Zimbabwe", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US };
+MY_LOCALE my_locale_en_ZW ( "en_ZW", "English - Zimbabwe", TRUE, &my_locale_typelib_month_names_en_US, &my_locale_typelib_ab_month_names_en_US, &my_locale_typelib_day_names_en_US, &my_locale_typelib_ab_day_names_en_US );
/***** LOCALE END en_ZW *****/
/***** LOCALE BEGIN es_AR: Spanish - Argentina *****/
-MY_LOCALE my_locale_es_AR=
- { "es_AR", "Spanish - Argentina", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_AR ( "es_AR", "Spanish - Argentina", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_AR *****/
/***** LOCALE BEGIN es_BO: Spanish - Bolivia *****/
-MY_LOCALE my_locale_es_BO=
- { "es_BO", "Spanish - Bolivia", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_BO ( "es_BO", "Spanish - Bolivia", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_BO *****/
/***** LOCALE BEGIN es_CL: Spanish - Chile *****/
-MY_LOCALE my_locale_es_CL=
- { "es_CL", "Spanish - Chile", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_CL ( "es_CL", "Spanish - Chile", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_CL *****/
/***** LOCALE BEGIN es_CO: Spanish - Columbia *****/
-MY_LOCALE my_locale_es_CO=
- { "es_CO", "Spanish - Columbia", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_CO ( "es_CO", "Spanish - Columbia", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_CO *****/
/***** LOCALE BEGIN es_CR: Spanish - Costa Rica *****/
-MY_LOCALE my_locale_es_CR=
- { "es_CR", "Spanish - Costa Rica", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_CR ( "es_CR", "Spanish - Costa Rica", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_CR *****/
/***** LOCALE BEGIN es_DO: Spanish - Dominican Republic *****/
-MY_LOCALE my_locale_es_DO=
- { "es_DO", "Spanish - Dominican Republic", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_DO ( "es_DO", "Spanish - Dominican Republic", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_DO *****/
/***** LOCALE BEGIN es_EC: Spanish - Ecuador *****/
-MY_LOCALE my_locale_es_EC=
- { "es_EC", "Spanish - Ecuador", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_EC ( "es_EC", "Spanish - Ecuador", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_EC *****/
/***** LOCALE BEGIN es_GT: Spanish - Guatemala *****/
-MY_LOCALE my_locale_es_GT=
- { "es_GT", "Spanish - Guatemala", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_GT ( "es_GT", "Spanish - Guatemala", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_GT *****/
/***** LOCALE BEGIN es_HN: Spanish - Honduras *****/
-MY_LOCALE my_locale_es_HN=
- { "es_HN", "Spanish - Honduras", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_HN ( "es_HN", "Spanish - Honduras", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_HN *****/
/***** LOCALE BEGIN es_MX: Spanish - Mexico *****/
-MY_LOCALE my_locale_es_MX=
- { "es_MX", "Spanish - Mexico", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_MX ( "es_MX", "Spanish - Mexico", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_MX *****/
/***** LOCALE BEGIN es_NI: Spanish - Nicaragua *****/
-MY_LOCALE my_locale_es_NI=
- { "es_NI", "Spanish - Nicaragua", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_NI ( "es_NI", "Spanish - Nicaragua", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_NI *****/
/***** LOCALE BEGIN es_PA: Spanish - Panama *****/
-MY_LOCALE my_locale_es_PA=
- { "es_PA", "Spanish - Panama", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_PA ( "es_PA", "Spanish - Panama", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_PA *****/
/***** LOCALE BEGIN es_PE: Spanish - Peru *****/
-MY_LOCALE my_locale_es_PE=
- { "es_PE", "Spanish - Peru", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_PE ( "es_PE", "Spanish - Peru", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_PE *****/
/***** LOCALE BEGIN es_PR: Spanish - Puerto Rico *****/
-MY_LOCALE my_locale_es_PR=
- { "es_PR", "Spanish - Puerto Rico", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_PR ( "es_PR", "Spanish - Puerto Rico", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_PR *****/
/***** LOCALE BEGIN es_PY: Spanish - Paraguay *****/
-MY_LOCALE my_locale_es_PY=
- { "es_PY", "Spanish - Paraguay", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_PY ( "es_PY", "Spanish - Paraguay", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_PY *****/
/***** LOCALE BEGIN es_SV: Spanish - El Salvador *****/
-MY_LOCALE my_locale_es_SV=
- { "es_SV", "Spanish - El Salvador", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_SV ( "es_SV", "Spanish - El Salvador", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_SV *****/
/***** LOCALE BEGIN es_US: Spanish - United States *****/
-MY_LOCALE my_locale_es_US=
- { "es_US", "Spanish - United States", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_US ( "es_US", "Spanish - United States", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_US *****/
/***** LOCALE BEGIN es_UY: Spanish - Uruguay *****/
-MY_LOCALE my_locale_es_UY=
- { "es_UY", "Spanish - Uruguay", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_UY ( "es_UY", "Spanish - Uruguay", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_UY *****/
/***** LOCALE BEGIN es_VE: Spanish - Venezuela *****/
-MY_LOCALE my_locale_es_VE=
- { "es_VE", "Spanish - Venezuela", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES };
+MY_LOCALE my_locale_es_VE ( "es_VE", "Spanish - Venezuela", FALSE, &my_locale_typelib_month_names_es_ES, &my_locale_typelib_ab_month_names_es_ES, &my_locale_typelib_day_names_es_ES, &my_locale_typelib_ab_day_names_es_ES );
/***** LOCALE END es_VE *****/
/***** LOCALE BEGIN fr_BE: French - Belgium *****/
-MY_LOCALE my_locale_fr_BE=
- { "fr_BE", "French - Belgium", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR };
+MY_LOCALE my_locale_fr_BE ( "fr_BE", "French - Belgium", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR );
/***** LOCALE END fr_BE *****/
/***** LOCALE BEGIN fr_CA: French - Canada *****/
-MY_LOCALE my_locale_fr_CA=
- { "fr_CA", "French - Canada", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR };
+MY_LOCALE my_locale_fr_CA ( "fr_CA", "French - Canada", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR );
/***** LOCALE END fr_CA *****/
/***** LOCALE BEGIN fr_CH: French - Switzerland *****/
-MY_LOCALE my_locale_fr_CH=
- { "fr_CH", "French - Switzerland", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR };
+MY_LOCALE my_locale_fr_CH ( "fr_CH", "French - Switzerland", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR );
/***** LOCALE END fr_CH *****/
/***** LOCALE BEGIN fr_LU: French - Luxembourg *****/
-MY_LOCALE my_locale_fr_LU=
- { "fr_LU", "French - Luxembourg", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR };
+MY_LOCALE my_locale_fr_LU ( "fr_LU", "French - Luxembourg", FALSE, &my_locale_typelib_month_names_fr_FR, &my_locale_typelib_ab_month_names_fr_FR, &my_locale_typelib_day_names_fr_FR, &my_locale_typelib_ab_day_names_fr_FR );
/***** LOCALE END fr_LU *****/
/***** LOCALE BEGIN it_IT: Italian - Italy *****/
-MY_LOCALE my_locale_it_IT=
- { "it_IT", "Italian - Italy", FALSE, &my_locale_typelib_month_names_it_CH, &my_locale_typelib_ab_month_names_it_CH, &my_locale_typelib_day_names_it_CH, &my_locale_typelib_ab_day_names_it_CH };
+MY_LOCALE my_locale_it_IT ( "it_IT", "Italian - Italy", FALSE, &my_locale_typelib_month_names_it_CH, &my_locale_typelib_ab_month_names_it_CH, &my_locale_typelib_day_names_it_CH, &my_locale_typelib_ab_day_names_it_CH );
/***** LOCALE END it_IT *****/
/***** LOCALE BEGIN nl_BE: Dutch - Belgium *****/
-MY_LOCALE my_locale_nl_BE=
- { "nl_BE", "Dutch - Belgium", TRUE, &my_locale_typelib_month_names_nl_NL, &my_locale_typelib_ab_month_names_nl_NL, &my_locale_typelib_day_names_nl_NL, &my_locale_typelib_ab_day_names_nl_NL };
+MY_LOCALE my_locale_nl_BE ( "nl_BE", "Dutch - Belgium", TRUE, &my_locale_typelib_month_names_nl_NL, &my_locale_typelib_ab_month_names_nl_NL, &my_locale_typelib_day_names_nl_NL, &my_locale_typelib_ab_day_names_nl_NL );
/***** LOCALE END nl_BE *****/
/***** LOCALE BEGIN no_NO: Norwegian - Norway *****/
-MY_LOCALE my_locale_no_NO=
- { "no_NO", "Norwegian - Norway", FALSE, &my_locale_typelib_month_names_nb_NO, &my_locale_typelib_ab_month_names_nb_NO, &my_locale_typelib_day_names_nb_NO, &my_locale_typelib_ab_day_names_nb_NO };
+MY_LOCALE my_locale_no_NO ( "no_NO", "Norwegian - Norway", FALSE, &my_locale_typelib_month_names_nb_NO, &my_locale_typelib_ab_month_names_nb_NO, &my_locale_typelib_day_names_nb_NO, &my_locale_typelib_ab_day_names_nb_NO );
/***** LOCALE END no_NO *****/
/***** LOCALE BEGIN sv_FI: Swedish - Finland *****/
-MY_LOCALE my_locale_sv_FI=
- { "sv_FI", "Swedish - Finland", FALSE, &my_locale_typelib_month_names_sv_SE, &my_locale_typelib_ab_month_names_sv_SE, &my_locale_typelib_day_names_sv_SE, &my_locale_typelib_ab_day_names_sv_SE };
+MY_LOCALE my_locale_sv_FI ( "sv_FI", "Swedish - Finland", FALSE, &my_locale_typelib_month_names_sv_SE, &my_locale_typelib_ab_month_names_sv_SE, &my_locale_typelib_day_names_sv_SE, &my_locale_typelib_ab_day_names_sv_SE );
/***** LOCALE END sv_FI *****/
/***** LOCALE BEGIN zh_HK: Chinese - Hong Kong SAR *****/
-MY_LOCALE my_locale_zh_HK=
- { "zh_HK", "Chinese - Hong Kong SAR", FALSE, &my_locale_typelib_month_names_zh_CN, &my_locale_typelib_ab_month_names_zh_CN, &my_locale_typelib_day_names_zh_CN, &my_locale_typelib_ab_day_names_zh_CN };
+MY_LOCALE my_locale_zh_HK ( "zh_HK", "Chinese - Hong Kong SAR", FALSE, &my_locale_typelib_month_names_zh_CN, &my_locale_typelib_ab_month_names_zh_CN, &my_locale_typelib_day_names_zh_CN, &my_locale_typelib_ab_day_names_zh_CN );
/***** LOCALE END zh_HK *****/
MY_LOCALE *my_locales[]=
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index eafd0e93cdb..2aceccd1c92 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5354,10 +5354,21 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables)
return 1;
/* Check rights on tables of subselects and implictly opened tables */
- TABLE_LIST *subselects_tables;
+ TABLE_LIST *subselects_tables, *view= all_tables->view ? all_tables : 0;
if ((subselects_tables= all_tables->next_global))
{
- if ((check_table_access(thd, SELECT_ACL, subselects_tables, 0)))
+ /*
+ Access rights asked for the first table of a view should be the same
+ as for the view
+ */
+ if (view && subselects_tables->belong_to_view == view)
+ {
+ if (check_single_table_access (thd, privilege, subselects_tables))
+ return 1;
+ subselects_tables= subselects_tables->next_global;
+ }
+ if (subselects_tables &&
+ (check_table_access(thd, SELECT_ACL, subselects_tables, 0)))
return 1;
}
return 0;
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 49ca738ae7f..af69c16c7e5 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -868,6 +868,7 @@ int check_signed_flag(partition_info *part_info)
bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
bool is_sub_part, bool is_field_to_be_setup)
{
+ MEM_ROOT new_mem_root;
partition_info *part_info= table->part_info;
uint dir_length, home_dir_length;
bool result= TRUE;
@@ -917,7 +918,25 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
func_expr->walk(&Item::change_context_processor, 0, (byte*) context);
save_where= thd->where;
thd->where= "partition function";
+ /*
+ In execution we must avoid the use of thd->change_item_tree since
+ we might release memory before statement is completed. We do this
+ by temporarily setting the stmt_arena->mem_root to be the mem_root
+ of the table object, this also ensures that any memory allocated
+ during fix_fields will not be released at end of execution of this
+ statement. Thus the item tree will remain valid also in subsequent
+ executions of this table object. We do however not at the moment
+ support allocations during execution of val_int so any item class
+ that does this during val_int must be disallowed as partition
+ function.
+ SEE Bug #21658
+ */
+ /*
+ This is a tricky call to prepare for since it can have a large number
+ of interesting side effects, both desirable and undesirable.
+ */
error= func_expr->fix_fields(thd, (Item**)0);
+
context->table_list= save_table_list;
context->first_name_resolution_table= save_first_table;
context->last_name_resolution_table= save_last_table;
@@ -1402,7 +1421,6 @@ bool fix_partition_func(THD *thd, TABLE *table,
bool result= TRUE;
partition_info *part_info= table->part_info;
enum_mark_columns save_mark_used_columns= thd->mark_used_columns;
- Item *thd_free_list= thd->free_list;
DBUG_ENTER("fix_partition_func");
if (part_info->fixed)
@@ -1422,7 +1440,6 @@ bool fix_partition_func(THD *thd, TABLE *table,
DBUG_RETURN(TRUE);
}
}
- thd->free_list= part_info->item_free_list;
if (part_info->is_sub_partitioned())
{
DBUG_ASSERT(part_info->subpart_type == HASH_PARTITION);
@@ -1530,7 +1547,6 @@ bool fix_partition_func(THD *thd, TABLE *table,
set_up_range_analysis_info(part_info);
result= FALSE;
end:
- thd->free_list= thd_free_list;
thd->mark_used_columns= save_mark_used_columns;
DBUG_PRINT("info", ("thd->mark_used_columns: %d", thd->mark_used_columns));
DBUG_RETURN(result);
@@ -2573,10 +2589,13 @@ uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
}
else
{
- if (part_func_value == range_array[loc_part_id])
- loc_part_id += test(include_endpoint);
- else if (part_func_value > range_array[loc_part_id])
- loc_part_id++;
+ if (loc_part_id < max_partition)
+ {
+ if (part_func_value == range_array[loc_part_id])
+ loc_part_id += test(include_endpoint);
+ else if (part_func_value > range_array[loc_part_id])
+ loc_part_id++;
+ }
loc_part_id++;
}
DBUG_RETURN(loc_part_id);
@@ -3365,7 +3384,6 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
TABLE* table, bool is_create_table_ind,
handlerton *default_db_type)
{
- Item *thd_free_list= thd->free_list;
bool result= TRUE;
partition_info *part_info;
CHARSET_INFO *old_character_set_client= thd->variables.character_set_client;
@@ -3393,7 +3411,6 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
Thus we move away the current list temporarily and start a new list that
we then save in the partition info structure.
*/
- thd->free_list= NULL;
lex.part_info= new partition_info();/* Indicates MYSQLparse from this place */
if (!lex.part_info)
{
@@ -3405,7 +3422,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
DBUG_PRINT("info", ("Parse: %s", part_buf));
if (MYSQLparse((void*)thd) || thd->is_fatal_error)
{
- free_items(thd->free_list);
+ thd->free_items();
goto end;
}
/*
@@ -3463,23 +3480,16 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
just to ensure we don't get into strange situations with the
item objects.
*/
- free_items(thd->free_list);
+ thd->free_items();
part_info= thd->work_part_info;
- thd->free_list= NULL;
table->s->version= 0UL;
}
}
table->part_info= part_info;
table->file->set_part_info(part_info);
- if (part_info->default_engine_type == NULL)
- {
+ if (!part_info->default_engine_type)
part_info->default_engine_type= default_db_type;
- }
- else
- {
- DBUG_ASSERT(part_info->default_engine_type == default_db_type);
- }
- part_info->item_free_list= thd->free_list;
+ DBUG_ASSERT(part_info->default_engine_type == default_db_type);
{
/*
@@ -3501,8 +3511,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
!((subpart_func_string= thd->alloc(subpart_func_len)))))
{
mem_alloc_error(part_func_len);
- free_items(thd->free_list);
- part_info->item_free_list= 0;
+ thd->free_items();
goto end;
}
if (part_func_len)
@@ -3517,7 +3526,6 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
result= FALSE;
end:
lex_end(thd->lex);
- thd->free_list= thd_free_list;
thd->lex= old_lex;
thd->variables.character_set_client= old_character_set_client;
DBUG_RETURN(result);
@@ -4392,6 +4400,13 @@ state of p1.
my_error(ER_REORG_HASH_ONLY_ON_SAME_NO, MYF(0));
DBUG_RETURN(TRUE);
}
+ if (tab_part_info->is_sub_partitioned() &&
+ alt_part_info->no_subparts &&
+ alt_part_info->no_subparts != tab_part_info->no_subparts)
+ {
+ my_error(ER_PARTITION_WRONG_NO_SUBPART_ERROR, MYF(0));
+ DBUG_RETURN(TRUE);
+ }
check_total_partitions= tab_part_info->no_parts + no_parts_new;
check_total_partitions-= no_parts_reorged;
if (check_total_partitions > MAX_PARTITIONS)
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 636a1d7c188..e048271ed3a 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -344,7 +344,7 @@ JOIN::prepare(Item ***rref_pointer_array,
setup_tables_and_check_access(thd, &select_lex->context, join_list,
tables_list,
&select_lex->leaf_tables, FALSE,
- SELECT_ACL)) ||
+ SELECT_ACL, SELECT_ACL)) ||
setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) ||
select_lex->setup_ref_array(thd, og_num) ||
setup_fields(thd, (*rref_pointer_array), fields_list, MARK_COLUMNS_READ,
@@ -2233,6 +2233,7 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
int ref_changed;
do
{
+ more_const_tables_found:
ref_changed = 0;
found_ref=0;
@@ -2244,6 +2245,30 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
for (JOIN_TAB **pos=stat_vector+const_count ; (s= *pos) ; pos++)
{
table=s->table;
+
+ /*
+ If equi-join condition by a key is null rejecting and after a
+ substitution of a const table the key value happens to be null
+ then we can state that there are no matches for this equi-join.
+ */
+ if ((keyuse= s->keyuse) && *s->on_expr_ref)
+ {
+ while (keyuse->table == table)
+ {
+ if (!(keyuse->val->used_tables() & ~join->const_table_map) &&
+ keyuse->val->is_null() && keyuse->null_rejecting)
+ {
+ s->type= JT_CONST;
+ mark_as_null_row(table);
+ found_const_table_map|= table->map;
+ join->const_table_map|= table->map;
+ set_position(join,const_count++,s,(KEYUSE*) 0);
+ goto more_const_tables_found;
+ }
+ keyuse++;
+ }
+ }
+
if (s->dependent) // If dependent on some table
{
// All dep. must be constants
@@ -2294,34 +2319,38 @@ make_join_statistics(JOIN *join, TABLE_LIST *tables, COND *conds,
} while (keyuse->table == table && keyuse->key == key);
if (eq_part.is_prefix(table->key_info[key].key_parts) &&
- ((table->key_info[key].flags & (HA_NOSAME | HA_END_SPACE_KEY)) ==
- HA_NOSAME) &&
!table->fulltext_searched &&
!table->pos_in_table_list->embedding)
{
- if (const_ref == eq_part)
- { // Found everything for ref.
- int tmp;
- ref_changed = 1;
- s->type= JT_CONST;
- join->const_table_map|=table->map;
- set_position(join,const_count++,s,start_keyuse);
- if (create_ref_for_key(join, s, start_keyuse,
- found_const_table_map))
- DBUG_RETURN(1);
- if ((tmp=join_read_const_table(s,
- join->positions+const_count-1)))
- {
- if (tmp > 0)
- DBUG_RETURN(1); // Fatal error
+ if ((table->key_info[key].flags & (HA_NOSAME | HA_END_SPACE_KEY))
+ == HA_NOSAME)
+ {
+ if (const_ref == eq_part)
+ { // Found everything for ref.
+ int tmp;
+ ref_changed = 1;
+ s->type= JT_CONST;
+ join->const_table_map|=table->map;
+ set_position(join,const_count++,s,start_keyuse);
+ if (create_ref_for_key(join, s, start_keyuse,
+ found_const_table_map))
+ DBUG_RETURN(1);
+ if ((tmp=join_read_const_table(s,
+ join->positions+const_count-1)))
+ {
+ if (tmp > 0)
+ DBUG_RETURN(1); // Fatal error
+ }
+ else
+ found_const_table_map|= table->map;
+ break;
}
else
- found_const_table_map|= table->map;
- break;
+ found_ref|= refs; // Table is const if all refs are const
}
- else
- found_ref|= refs; // Table is const if all refs are const
- }
+ else if (const_ref == eq_part)
+ s->const_keys.set_bit(key);
+ }
}
}
}
@@ -2727,7 +2756,8 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, Item_func *cond,
We use null_rejecting in add_not_null_conds() to add
'othertbl.field IS NOT NULL' to tab->select_cond.
*/
- (*key_fields)->null_rejecting= ((cond->functype() == Item_func::EQ_FUNC) &&
+ (*key_fields)->null_rejecting= ((cond->functype() == Item_func::EQ_FUNC ||
+ cond->functype() == Item_func::MULT_EQUAL_FUNC) &&
((*value)->type() == Item::FIELD_ITEM) &&
((Item_field*)*value)->field->maybe_null());
(*key_fields)++;
@@ -2827,11 +2857,12 @@ add_key_fields(KEY_FIELD **key_fields,uint *and_level,
break;
case Item_func::OPTIMIZE_KEY:
{
+ Item **values;
// BETWEEN, IN, NE
if (cond_func->key_item()->real_item()->type() == Item::FIELD_ITEM &&
!(cond_func->used_tables() & OUTER_REF_TABLE_BIT))
{
- Item **values= cond_func->arguments()+1;
+ values= cond_func->arguments()+1;
if (cond_func->functype() == Item_func::NE_FUNC &&
cond_func->arguments()[1]->real_item()->type() == Item::FIELD_ITEM &&
!(cond_func->arguments()[0]->used_tables() & OUTER_REF_TABLE_BIT))
@@ -2844,6 +2875,22 @@ add_key_fields(KEY_FIELD **key_fields,uint *and_level,
cond_func->argument_count()-1,
usable_tables);
}
+ if (cond_func->functype() == Item_func::BETWEEN)
+ {
+ values= cond_func->arguments();
+ for (uint i= 1 ; i < cond_func->argument_count() ; i++)
+ {
+ Item_field *field_item;
+ if (cond_func->arguments()[i]->real_item()->type() == Item::FIELD_ITEM
+ &&
+ !(cond_func->arguments()[i]->used_tables() & OUTER_REF_TABLE_BIT))
+ {
+ field_item= (Item_field *) (cond_func->arguments()[i]->real_item());
+ add_key_equal_fields(key_fields, *and_level, cond_func,
+ field_item, 0, values, 1, usable_tables);
+ }
+ }
+ }
break;
}
case Item_func::OPTIMIZE_OP:
@@ -3476,7 +3523,7 @@ best_access_path(JOIN *join,
keyuse->used_tables));
if (tmp < best_prev_record_reads)
{
- best_part_found_ref= keyuse->used_tables;
+ best_part_found_ref= keyuse->used_tables & ~join->const_table_map;
best_prev_record_reads= tmp;
}
if (rec > keyuse->ref_table_rows)
@@ -6034,7 +6081,8 @@ eq_ref_table(JOIN *join, ORDER *start_order, JOIN_TAB *tab)
if (tab->cached_eq_ref_table) // If cached
return tab->eq_ref_table;
tab->cached_eq_ref_table=1;
- if (tab->type == JT_CONST) // We can skip const tables
+ /* We can skip const tables only if not an outer table */
+ if (tab->type == JT_CONST && !tab->first_inner)
return (tab->eq_ref_table=1); /* purecov: inspected */
if (tab->type != JT_EQ_REF || tab->table->maybe_null)
return (tab->eq_ref_table=0); // We must use this
@@ -6556,6 +6604,7 @@ static bool check_equality(Item *item, COND_EQUAL *cond_equal)
field_item= (Item_field*) right_item;
const_item= left_item;
}
+
if (const_item &&
field_item->result_type() == const_item->result_type())
{
@@ -7213,6 +7262,7 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
Item_func::Functype functype= func->functype();
if (right_item->eq(field,0) && left_item != value &&
+ right_item->cmp_context == field->cmp_context &&
(left_item->result_type() != STRING_RESULT ||
value->result_type() != STRING_RESULT ||
left_item->collation.collation == value->collation.collation))
@@ -7234,6 +7284,7 @@ change_cond_ref_to_const(THD *thd, I_List<COND_CMP> *save_list,
}
}
else if (left_item->eq(field,0) && right_item != value &&
+ left_item->cmp_context == field->cmp_context &&
(right_item->result_type() != STRING_RESULT ||
value->result_type() != STRING_RESULT ||
right_item->collation.collation == value->collation.collation))
@@ -11619,6 +11670,8 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
We must not try to use disabled keys.
*/
usable_keys= table->s->keys_in_use;
+ /* we must not consider keys that are disabled by IGNORE INDEX */
+ usable_keys.intersect(table->keys_in_use_for_query);
for (ORDER *tmp_order=order; tmp_order ; tmp_order=tmp_order->next)
{
@@ -13489,7 +13542,9 @@ change_to_use_tmp_fields(THD *thd, Item **ref_pointer_array,
{
Field *field;
- if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM)
+ if ((item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM) ||
+ (item->type() == Item::FUNC_ITEM &&
+ ((Item_func*)item)->functype() == Item_func::SUSERVAR_FUNC))
item_field= item;
else
{
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index b944da086a8..a8bf2695ac4 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -5149,7 +5149,7 @@ static my_bool run_hton_fill_schema_files(THD *thd, st_plugin_int *plugin,
struct run_hton_fill_schema_files_args *args=
(run_hton_fill_schema_files_args *) arg;
handlerton *hton= (handlerton *)plugin->data;
- if(hton->fill_files_table)
+ if(hton->fill_files_table && hton->state == SHOW_OPTION_YES)
hton->fill_files_table(thd, args->tables, args->cond);
return false;
}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 1b97acbcbfe..b62e80edfab 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -746,7 +746,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list,
&select_lex->top_join_list,
table_list,
&select_lex->leaf_tables,
- FALSE, UPDATE_ACL) ||
+ FALSE, UPDATE_ACL, SELECT_ACL) ||
setup_conds(thd, table_list, select_lex->leaf_tables, conds) ||
select_lex->setup_ref_array(thd, order_num) ||
setup_order(thd, select_lex->ref_pointer_array,
@@ -841,7 +841,7 @@ reopen_tables:
&lex->select_lex.top_join_list,
table_list,
&lex->select_lex.leaf_tables, FALSE,
- UPDATE_ACL))
+ UPDATE_ACL, SELECT_ACL))
DBUG_RETURN(TRUE);
if (setup_fields_with_no_wrap(thd, 0, *fields, MARK_COLUMNS_WRITE, 0, 0))
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 3c01c608843..8527f110ce2 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -780,10 +780,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
%type <ulong_num>
- ulong_num merge_insert_types
+ ulong_num real_ulong_num merge_insert_types
%type <ulonglong_number>
- ulonglong_num size_number
+ ulonglong_num real_ulonglong_num size_number
%type <p_elem_value>
part_bit_expr
@@ -3125,7 +3125,7 @@ opt_ts_redo_buffer_size:
};
opt_ts_nodegroup:
- NODEGROUP_SYM opt_equal ulong_num
+ NODEGROUP_SYM opt_equal real_ulong_num
{
LEX *lex= Lex;
if (lex->alter_tablespace_info->nodegroup_id != UNDEF_NODEGROUP)
@@ -3184,7 +3184,7 @@ ts_wait:
};
size_number:
- ulong_num { $$= $1;}
+ real_ulong_num { $$= $1;}
| IDENT
{
ulonglong number, test_number;
@@ -3423,7 +3423,7 @@ sub_part_func:
opt_no_parts:
/* empty */ {}
- | PARTITIONS_SYM ulong_num
+ | PARTITIONS_SYM real_ulong_num
{
uint no_parts= $2;
LEX *lex= Lex;
@@ -3487,7 +3487,7 @@ part_func_expr:
opt_no_subparts:
/* empty */ {}
- | SUBPARTITIONS_SYM ulong_num
+ | SUBPARTITIONS_SYM real_ulong_num
{
uint no_parts= $2;
LEX *lex= Lex;
@@ -3827,11 +3827,11 @@ opt_part_option:
lex->part_info->curr_part_elem->engine_type= $4;
lex->part_info->default_engine_type= $4;
}
- | NODEGROUP_SYM opt_equal ulong_num
+ | NODEGROUP_SYM opt_equal real_ulong_num
{ Lex->part_info->curr_part_elem->nodegroup_id= $3; }
- | MAX_ROWS opt_equal ulonglong_num
+ | MAX_ROWS opt_equal real_ulonglong_num
{ Lex->part_info->curr_part_elem->part_max_rows= $3; }
- | MIN_ROWS opt_equal ulonglong_num
+ | MIN_ROWS opt_equal real_ulonglong_num
{ Lex->part_info->curr_part_elem->part_min_rows= $3; }
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
{ Lex->part_info->curr_part_elem->data_file_name= $4.str; }
@@ -4961,7 +4961,7 @@ alter_commands:
lex->check_opt.init();
}
opt_mi_repair_type
- | COALESCE PARTITION_SYM opt_no_write_to_binlog ulong_num
+ | COALESCE PARTITION_SYM opt_no_write_to_binlog real_ulong_num
{
LEX *lex= Lex;
lex->alter_info.flags|= ALTER_COALESCE_PARTITION;
@@ -5009,7 +5009,7 @@ add_part_extra:
LEX *lex= Lex;
lex->part_info->no_parts= lex->part_info->partitions.elements;
}
- | PARTITIONS_SYM ulong_num
+ | PARTITIONS_SYM real_ulong_num
{
LEX *lex= Lex;
lex->part_info->no_parts= $2;
@@ -7548,7 +7548,15 @@ ulong_num:
| ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| DECIMAL_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
| FLOAT_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
- ;
+ ;
+
+real_ulong_num:
+ NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | HEX_NUM { $$= (ulong) strtol($1.str, (char**) 0, 16); }
+ | LONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulong) my_strtoll10($1.str, (char**) 0, &error); }
+ | dec_num_error { YYABORT; }
+ ;
ulonglong_num:
NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
@@ -7558,6 +7566,23 @@ ulonglong_num:
| FLOAT_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
;
+real_ulonglong_num:
+ NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | ULONGLONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | LONG_NUM { int error; $$= (ulonglong) my_strtoll10($1.str, (char**) 0, &error); }
+ | dec_num_error { YYABORT; }
+ ;
+
+dec_num_error:
+ dec_num
+ { yyerror(ER(ER_ONLY_INTEGERS_ALLOWED)); }
+ ;
+
+dec_num:
+ DECIMAL_NUM
+ | FLOAT_NUM
+ ;
+
procedure_clause:
/* empty */
| PROCEDURE ident /* Procedure name */
diff --git a/sql/table.cc b/sql/table.cc
index 7afeb466f8e..fe83398115d 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1471,11 +1471,23 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (share->partition_info_len)
{
- MEM_ROOT **root_ptr, *old_root;
+ /*
+ In this execution we must avoid calling thd->change_item_tree since
+ we might release memory before statement is completed. We do this
+ by changing to a new statement arena. As part of this arena we also
+ set the memory root to be the memory root of the table since we
+ call the parser and fix_fields which both can allocate memory for
+ item objects. We keep the arena to ensure that we can release the
+ free_list when closing the table object.
+ SEE Bug #21658
+ */
+
+ Query_arena *backup_stmt_arena_ptr= thd->stmt_arena;
+ Query_arena backup_arena;
+ Query_arena part_func_arena(&outparam->mem_root, Query_arena::INITIALIZED);
+ thd->set_n_backup_active_arena(&part_func_arena, &backup_arena);
+ thd->stmt_arena= &part_func_arena;
bool tmp;
- root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC);
- old_root= *root_ptr;
- *root_ptr= &outparam->mem_root;
tmp= mysql_unpack_partition(thd, share->partition_info,
share->partition_info_len,
@@ -1487,7 +1499,10 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
DBUG_PRINT("info", ("autopartitioned: %u", share->auto_partitioned));
if (!tmp)
tmp= fix_partition_func(thd, outparam, is_create_table);
- *root_ptr= old_root;
+ thd->stmt_arena= backup_stmt_arena_ptr;
+ thd->restore_active_arena(&part_func_arena, &backup_arena);
+ if (!tmp)
+ outparam->part_info->item_free_list= part_func_arena.free_list;
if (tmp)
{
if (is_create_table)
diff --git a/storage/innobase/btr/btr0btr.c b/storage/innobase/btr/btr0btr.c
index ae3e722b513..d5f4db744dc 100644
--- a/storage/innobase/btr/btr0btr.c
+++ b/storage/innobase/btr/btr0btr.c
@@ -624,7 +624,7 @@ btr_page_get_father_for_rec(
fputs(
"InnoDB: You should dump + drop + reimport the table to fix the\n"
"InnoDB: corruption. If the crash happens at the database startup, see\n"
-"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html about\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html about\n"
"InnoDB: forcing recovery. Then dump + drop + reimport.\n", stderr);
}
diff --git a/storage/innobase/buf/buf0buf.c b/storage/innobase/buf/buf0buf.c
index 5f3e4a9ea50..feb1cc48a8e 100644
--- a/storage/innobase/buf/buf0buf.c
+++ b/storage/innobase/buf/buf0buf.c
@@ -323,7 +323,8 @@ buf_page_is_corrupted(
"InnoDB: is in the future! Current system log sequence number %lu %lu.\n"
"InnoDB: Your database may be corrupt or you may have copied the InnoDB\n"
"InnoDB: tablespace but not the InnoDB log files. See\n"
-"http://dev.mysql.com/doc/mysql/en/backing-up.html for more information.\n",
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
+"InnoDB: for more information.\n",
(ulong) mach_read_from_4(read_buf + FIL_PAGE_OFFSET),
(ulong) ut_dulint_get_high(
mach_read_from_8(read_buf + FIL_PAGE_LSN)),
@@ -1923,7 +1924,7 @@ buf_page_io_complete(
"InnoDB: the corrupt table. You can use CHECK\n"
"InnoDB: TABLE to scan your table for corruption.\n"
"InnoDB: See also "
- "http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index ce075138cb1..b696bd48722 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -2215,8 +2215,8 @@ dict_foreign_error_report(
if (fk->foreign_index) {
fputs("The index in the foreign key in table is ", file);
ut_print_name(file, NULL, FALSE, fk->foreign_index->name);
- fputs(
-"\nSee http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
+ fputs("\n"
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html\n"
"for correct foreign key definition.\n",
file);
}
@@ -3119,7 +3119,7 @@ col_loop1:
ut_print_name(ef, NULL, TRUE, name);
fprintf(ef, " where the columns appear\n"
"as the first columns. Constraint:\n%s\n"
-"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html\n"
"for correct foreign key definition.\n",
start_of_latest_foreign);
mutex_exit(&dict_foreign_err_mutex);
@@ -3387,7 +3387,7 @@ try_find_index:
"Note that the internal storage type of ENUM and SET changed in\n"
"tables created with >= InnoDB-4.1.12, and such columns in old tables\n"
"cannot be referenced by such columns in new tables.\n"
-"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
+"See http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html\n"
"for correct foreign key definition.\n",
start_of_latest_foreign);
mutex_exit(&dict_foreign_err_mutex);
@@ -3941,8 +3941,7 @@ dict_update_statistics_low(
fprintf(stderr,
" InnoDB: cannot calculate statistics for table %s\n"
"InnoDB: because the .ibd file is missing. For help, please refer to\n"
-"InnoDB: "
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n",
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
table->name);
return;
diff --git a/storage/innobase/fil/fil0fil.c b/storage/innobase/fil/fil0fil.c
index b2935a119a5..05a73f97530 100644
--- a/storage/innobase/fil/fil0fil.c
+++ b/storage/innobase/fil/fil0fil.c
@@ -2685,8 +2685,7 @@ fil_open_single_table_tablespace(
"InnoDB: It is also possible that this is a temporary table #sql...,\n"
"InnoDB: and MySQL removed the .ibd file for this.\n"
"InnoDB: Please refer to\n"
-"InnoDB:"
-" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: for how to resolve the issue.\n", stderr);
mem_free(filepath);
@@ -2725,8 +2724,7 @@ fil_open_single_table_tablespace(
"InnoDB: Have you moved InnoDB .ibd files around without using the\n"
"InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE?\n"
"InnoDB: Please refer to\n"
-"InnoDB:"
-" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: for how to resolve the issue.\n", (ulong) space_id, (ulong) id);
ret = FALSE;
@@ -3373,8 +3371,7 @@ fil_space_for_table_exists_in_mem(
error_exit:
fputs(
"InnoDB: Please refer to\n"
-"InnoDB:"
-" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: for how to resolve the issue.\n", stderr);
mem_free(path);
diff --git a/storage/innobase/fsp/fsp0fsp.c b/storage/innobase/fsp/fsp0fsp.c
index 43c7ba005cb..2025e211896 100644
--- a/storage/innobase/fsp/fsp0fsp.c
+++ b/storage/innobase/fsp/fsp0fsp.c
@@ -2988,7 +2988,7 @@ fseg_free_page_low(
crash:
fputs(
"InnoDB: Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
ut_error;
}
diff --git a/storage/innobase/include/btr0cur.ic b/storage/innobase/include/btr0cur.ic
index a199c3d4d32..7fbdf6035b0 100644
--- a/storage/innobase/include/btr0cur.ic
+++ b/storage/innobase/include/btr0cur.ic
@@ -52,10 +52,7 @@ btr_cur_get_page(
/* out: pointer to page */
btr_cur_t* cursor) /* in: tree cursor */
{
- page_t* page = buf_frame_align(page_cur_get_rec(&(cursor->page_cur)));
- ut_ad(!!page_is_comp(page)
- == dict_table_is_comp(cursor->index->table));
- return(page);
+ return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur))));
}
/*************************************************************
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic
index 15187c03636..a1bed7b3dc1 100644
--- a/storage/innobase/include/buf0buf.ic
+++ b/storage/innobase/include/buf0buf.ic
@@ -216,8 +216,8 @@ buf_block_align(
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
-"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
-"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
+"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
ptr, frame_zero,
buf_pool->high_end);
@@ -252,8 +252,8 @@ buf_frame_align(
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
-"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
-"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
+"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
"InnoDB: how to force recovery.\n",
ptr, buf_pool->frame_zero,
buf_pool->high_end);
diff --git a/storage/innobase/log/log0log.c b/storage/innobase/log/log0log.c
index db6b8fabf6f..88906d33957 100644
--- a/storage/innobase/log/log0log.c
+++ b/storage/innobase/log/log0log.c
@@ -720,7 +720,7 @@ failure:
"InnoDB: To get mysqld to start up, set innodb_thread_concurrency in my.cnf\n"
"InnoDB: to a lower value, for example, to 8. After an ERROR-FREE shutdown\n"
"InnoDB: of mysqld you can adjust the size of ib_logfiles, as explained in\n"
-"InnoDB: http://dev.mysql.com/doc/mysql/en/Adding_and_removing.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/adding-and-removing.html\n"
"InnoDB: Cannot continue operation. Calling exit(1).\n",
(ulong)srv_thread_concurrency);
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index 63a90f05212..fd2c98a2f15 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -542,7 +542,7 @@ recv_find_max_checkpoint(
"InnoDB: the problem may be that during an earlier attempt you managed\n"
"InnoDB: to create the InnoDB data files, but log file creation failed.\n"
"InnoDB: If that is the case, please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/mysql/en/Error_creating_InnoDB.html\n");
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/error-creating-innodb.html\n");
return(DB_ERROR);
}
@@ -1962,7 +1962,7 @@ recv_report_corrupt_log(
"InnoDB: far enough in recovery! Please run CHECK TABLE\n"
"InnoDB: on your InnoDB tables to check that they are ok!\n"
"InnoDB: If mysqld crashes after this recovery, look at\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
+ "InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
fflush(stderr);
diff --git a/storage/innobase/os/os0file.c b/storage/innobase/os/os0file.c
index 74905ce06dd..c7b4ec9785d 100644
--- a/storage/innobase/os/os0file.c
+++ b/storage/innobase/os/os0file.c
@@ -248,7 +248,7 @@ os_file_get_last_error(
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
- "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
+ "http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n");
}
}
@@ -295,7 +295,7 @@ os_file_get_last_error(
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
- "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
+ "http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n");
}
}
@@ -688,7 +688,7 @@ next_file:
/* TODO: test Windows symlinks */
/* TODO: MySQL has apparently its own symlink implementation in Windows,
dbname.sym can redirect a database directory:
-http://www.mysql.com/doc/en/Windows_symbolic_links.html */
+http://dev.mysql.com/doc/refman/5.0/en/windows-symbolic-links.html */
info->type = OS_FILE_TYPE_LINK;
} else if (lpFindFileData->dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY) {
@@ -2343,7 +2343,7 @@ retry:
"InnoDB: offset %lu %lu. Operating system error number %lu.\n"
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
-"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n",
+"http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n",
name, (ulong) offset_high, (ulong) offset,
(ulong) GetLastError());
@@ -2408,7 +2408,7 @@ retry:
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
-"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
+"http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n");
os_has_said_disk_full = TRUE;
}
@@ -2444,7 +2444,7 @@ retry:
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
-"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
+"http://dev.mysql.com/doc/refman/5.0/en/operating-system-error-codes.html\n");
os_has_said_disk_full = TRUE;
}
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 5f4a882f4a8..c1ec8cc45a5 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -550,7 +550,7 @@ handle_new_error:
"InnoDB: tables and recreate the whole InnoDB tablespace.\n"
"InnoDB: If the mysqld server crashes after the startup or when\n"
"InnoDB: you dump the tables, look at\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html"
+ "InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html"
" for help.\n", stderr);
} else {
@@ -1083,7 +1083,7 @@ row_insert_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
@@ -1319,7 +1319,7 @@ row_update_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
@@ -1968,8 +1968,8 @@ row_create_table_for_mysql(
"InnoDB: Then MySQL thinks the table exists, and DROP TABLE will\n"
"InnoDB: succeed.\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+ stderr);
}
/* We may also get err == DB_ERROR if the .ibd file for the
@@ -3054,8 +3054,8 @@ row_drop_table_for_mysql(
"InnoDB: Have you copied the .frm file of the table to the\n"
"InnoDB: MySQL database directory from another database?\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+ stderr);
goto funct_exit;
}
@@ -3556,8 +3556,8 @@ row_rename_table_for_mysql(
"InnoDB: Have you copied the .frm file of the table to the\n"
"InnoDB: MySQL database directory from another database?\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+ stderr);
goto funct_exit;
}
@@ -3570,8 +3570,8 @@ row_rename_table_for_mysql(
fputs(
" does not have an .ibd file in the database directory.\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n",
+ stderr);
goto funct_exit;
}
@@ -3719,8 +3719,7 @@ end:
fputs(" to it.\n"
"InnoDB: Have you deleted the .frm file and not used DROP TABLE?\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: If table ", stderr);
ut_print_name(stderr, trx, TRUE, new_name);
fputs(
@@ -3968,7 +3967,7 @@ row_check_table_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index f79bda5d6d8..7d3b5129ec5 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -3245,7 +3245,7 @@ row_search_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
diff --git a/storage/innobase/srv/srv0start.c b/storage/innobase/srv/srv0start.c
index 205b54004ce..22456430c60 100644
--- a/storage/innobase/srv/srv0start.c
+++ b/storage/innobase/srv/srv0start.c
@@ -1691,7 +1691,7 @@ NetWare. */
"InnoDB: You have now successfully upgraded to the multiple tablespaces\n"
"InnoDB: format. You should NOT DOWNGRADE to an earlier version of\n"
"InnoDB: InnoDB! But if you absolutely need to downgrade, see\n"
-"InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/multiple-tablespaces.html\n"
"InnoDB: for instructions.\n");
}
diff --git a/storage/innobase/ut/ut0dbg.c b/storage/innobase/ut/ut0dbg.c
index a9391cd3adc..b2b4abd87a6 100644
--- a/storage/innobase/ut/ut0dbg.c
+++ b/storage/innobase/ut/ut0dbg.c
@@ -56,7 +56,7 @@ ut_dbg_assertion_failed(
"InnoDB: If you get repeated assertion failures or crashes, even\n"
"InnoDB: immediately after the mysqld startup, there may be\n"
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
ut_dbg_stop_threads = TRUE;
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index 02170f6aacb..0b57e5a555b 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -14968,7 +14968,7 @@ static void test_bug17667()
strcpy(master_log_filename, opt_vardir);
strcat(master_log_filename, "/log/master.log");
printf("Opening '%s'\n", master_log_filename);
- log_file= fopen(master_log_filename, "r");
+ log_file= my_fopen(master_log_filename, (int) (O_RDONLY | O_BINARY), MYF(MY_WME));
free(master_log_filename);
if (log_file != NULL) {
@@ -14993,6 +14993,8 @@ static void test_bug17667()
DIE("Read error");
}
}
+ /* Print the line */
+ printf("%s", line_buffer);
} while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2,
statement_cursor->buffer, statement_cursor->length) == NULL);
@@ -15013,7 +15015,7 @@ static void test_bug17667()
}
if (log_file != NULL)
- fclose(log_file);
+ my_fclose(log_file, MYF(0));
}