diff options
author | Timothy Smith <timothy.smith@sun.com> | 2008-08-22 13:04:38 -0600 |
---|---|---|
committer | Timothy Smith <timothy.smith@sun.com> | 2008-08-22 13:04:38 -0600 |
commit | a4b0681ad19cea6c506024690aaddbe13f7d3a03 (patch) | |
tree | 6e27cc70a7b1cd529adb5bed9cdcd9b137893852 | |
parent | 28e884d9e2642e018dd7fd3d0134c75d0b4d72cd (diff) | |
parent | de73b729543f40f46463c0134e380057ee4adb27 (diff) | |
download | mariadb-git-a4b0681ad19cea6c506024690aaddbe13f7d3a03.tar.gz |
Merge 5.0 main to 5.0-build
28 files changed, 250 insertions, 88 deletions
diff --git a/BUILD/check-cpu b/BUILD/check-cpu index 48a5b5371e3..4974d3f4ecc 100755 --- a/BUILD/check-cpu +++ b/BUILD/check-cpu @@ -169,7 +169,7 @@ check_cpu () { fi cc_ver=`$cc --version | sed 1q` - cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'` + cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'` set -- `echo $cc_verno | tr '.' ' '` cc_major=$1 cc_minor=$2 diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 685e4d0c335..2c001a9e860 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -2071,7 +2071,18 @@ DROP TABLE t1; DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://'; DROP TABLE t1; +CREATE TABLE t1 (a LONGBLOB, b LONGBLOB); +INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL); +CREATE TABLE t1 +(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +CHECKSUM TABLE t1; +Table Checksum +test.t1 2465757603 +DROP TABLE t1; +DROP TABLE t1; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; +End of 5.0 tests diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 4a776b6a253..a4b6fd2ce8f 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -108,11 +108,11 @@ id 1 select * from v1 group by id limit 0; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 v1 id id 3 10 0 Y 32768 0 63 +def test v1 v1 id id 3 10 0 Y 32768 0 63 id select * from v1 where id=1000 group by id; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 v1 id id 3 10 0 Y 32768 0 63 +def test v1 v1 id id 3 10 0 Y 32768 0 63 id select * from v1 where id=1 group by id; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr @@ -126,7 +126,7 @@ renamed 1 select * from v3 where renamed=1 group by renamed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def v3 renamed 8 12 0 Y 32896 0 63 +def v3 v3 renamed renamed 8 12 0 Y 32896 0 63 renamed drop table t1; drop view v1,v2,v3; @@ -156,8 +156,8 @@ c1 3 SELECT v1.c1, v2.c2 FROM v1 JOIN v2 ON c1=c2; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 v1 c1 c1 254 1 1 Y 0 0 8 -def test t2 v2 c2 c2 254 1 1 Y 0 0 8 +def test v1 v1 c1 c1 254 1 1 Y 0 0 8 +def test v2 v2 c2 c2 254 1 1 Y 0 0 8 c1 c2 1 1 2 2 diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 488c01b020c..83dcbc61e68 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -468,7 +468,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 14 N 1 31 8 @@ -484,7 +484,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 5 Y 0 31 8 def possible_keys 253 4096 7 Y 0 31 8 def key 253 64 7 Y 0 31 8 -def key_len 253 1365 1 Y 0 31 8 +def key_len 253 4096 1 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 27 N 1 31 8 diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 891e8e4ff02..43ec79609e4 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index abbaba7463c..ff9ddc8d95d 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index e6a4caadf1e..92f83d7cf8a 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1159,7 +1159,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 34ade911e78..b2353121422 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1201,7 +1201,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 @@ -4223,7 +4223,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index a4205ac134e..d70a89522e2 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 8eec789d061..502b7ce8591 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1158,7 +1158,7 @@ def table 253 64 2 Y 0 31 8 def type 253 10 3 Y 0 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 253 1365 0 Y 0 31 8 +def key_len 253 4096 0 Y 0 31 8 def ref 253 1024 0 Y 0 31 8 def rows 8 10 1 Y 32928 0 63 def Extra 253 255 0 N 1 31 8 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 0ad32d2f5ed..ad3138e80ea 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4); -- after Bug#29394 is implemented. check table t1 fast; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 5 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 27 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 5 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 27 Y 0 31 8 Table Op Msg_type Msg_text test.t1 check status Table is already up to date check table t1 fast; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 5 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 27 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 5 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 27 Y 0 31 8 Table Op Msg_type Msg_text test.t1 check status Table is already up to date check table t1 changed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 5 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 5 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 check status OK insert into t1 values (5,5,5); check table t1 changed; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 5 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 5 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 check status OK check table t1 medium; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 5 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 5 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 check status OK check table t1 extended; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 5 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 5 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 check status OK show index from t1; @@ -84,10 +84,10 @@ ERROR 23000: Duplicate entry '5' for key 1 -- after Bug#29394 is implemented. optimize table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 8 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 8 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 optimize status OK optimize table t1; @@ -154,10 +154,10 @@ insert into t1 values (1,1,1,0),(1,1,2,0),(1,1,3,0),(1,2,1,0),(1,2,2,0),(1,2,3,0 -- after Bug#29394 is implemented. analyze table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 7 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 7 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 analyze status OK show index from t1; @@ -171,10 +171,10 @@ t1 0 PRIMARY 4 f4 A 18 NULL NULL BTREE -- after Bug#29394 is implemented. repair table t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 42 7 Y 0 31 8 -def Op 253 3 6 Y 0 31 8 -def Msg_type 253 3 6 Y 0 31 8 -def Msg_text 253 85 2 Y 0 31 8 +def Table 253 128 7 Y 0 31 8 +def Op 253 10 6 Y 0 31 8 +def Msg_type 253 10 6 Y 0 31 8 +def Msg_text 253 255 2 Y 0 31 8 Table Op Msg_type Msg_text test.t1 repair status OK show index from t1; @@ -788,8 +788,8 @@ latin1_bin latin1 47 Yes 1 ---------------------------------------------------------------- SHOW CREATE DATABASE mysqltest1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Database 253 63 10 N 1 31 33 -def Create Database 253 1023 69 N 1 31 33 +def Database 253 192 10 N 1 31 33 +def Create Database 253 3072 69 N 1 31 33 Database Create Database mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */ ---------------------------------------------------------------- @@ -801,8 +801,8 @@ mysqltest1 ---------------------------------------------------------------- SHOW CREATE TABLE t1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Table 253 63 2 N 1 31 33 -def Create Table 253 1023 103 N 1 31 33 +def Table 253 192 2 N 1 31 33 +def Create Table 253 3072 103 N 1 31 33 Table Create Table t1 CREATE TABLE `t1` ( `c` int(11) NOT NULL, @@ -959,8 +959,8 @@ NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW ---------------------------------------------------------------- SHOW CREATE VIEW v1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def View 253 63 2 N 1 31 33 -def Create View 253 1023 103 N 1 31 33 +def View 253 192 2 N 1 31 33 +def Create View 253 3072 103 N 1 31 33 View Create View v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` ---------------------------------------------------------------- @@ -981,9 +981,9 @@ NULL test v1 /* ALGORITHM=UNDEFINED */ select 1 AS `1` NONE NO root@localhost DE ---------------------------------------------------------------- SHOW CREATE PROCEDURE p1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Procedure 253 63 2 N 1 31 33 +def Procedure 253 192 2 N 1 31 33 def sql_mode 253 0 0 N 1 31 33 -def Create Procedure 253 2046 59 Y 0 31 33 +def Create Procedure 253 6144 59 Y 0 31 33 Procedure sql_mode Create Procedure p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() SELECT 1 @@ -1033,9 +1033,9 @@ p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL D ---------------------------------------------------------------- SHOW CREATE FUNCTION f1; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -def Function 253 63 2 N 1 31 33 +def Function 253 192 2 N 1 31 33 def sql_mode 253 0 0 N 1 31 33 -def Create Function 253 2046 74 Y 0 31 33 +def Create Function 253 6144 74 Y 0 31 33 Function sql_mode Create Function f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) RETURN 1 @@ -1141,4 +1141,34 @@ Slow_queries 2 show variables like 'myisam_recover_options'; Variable_name Value myisam_recover_options OFF +CREATE TABLE t1 ( +Codigo int(10) unsigned NOT NULL auto_increment, +Nombre varchar(255) default NULL, +Telefono varchar(255) default NULL, +Observaciones longtext, +Direccion varchar(255) default NULL, +Dni varchar(255) default NULL, +CP int(11) default NULL, +Provincia varchar(255) default NULL, +Poblacion varchar(255) default NULL, +PRIMARY KEY (Codigo) +) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +show create table t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def Table 253 64 2 N 1 31 7 +def Create Table 253 1024 446 N 1 31 7 +Table Create Table +t1 CREATE TABLE `t1` ( + `Codigo` int(10) unsigned NOT NULL auto_increment, + `Nombre` varchar(255) default NULL, + `Telefono` varchar(255) default NULL, + `Observaciones` longtext, + `Direccion` varchar(255) default NULL, + `Dni` varchar(255) default NULL, + `CP` int(11) default NULL, + `Provincia` varchar(255) default NULL, + `Poblacion` varchar(255) default NULL, + PRIMARY KEY (`Codigo`) +) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 +drop table t1; End of 5.0 tests diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 562102f0ea7..be21251d92e 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -6646,6 +6646,22 @@ ttt 2 drop function func30787; drop table t1; +create table t1(c1 INT); +create function f1(p1 int) returns varchar(32) +return 'aaa'; +create view v1 as select f1(c1) as parent_control_name from t1; +create procedure p1() +begin +select parent_control_name as c1 from v1; +end // +call p1(); +c1 +call p1(); +c1 +drop procedure p1; +drop function f1; +drop view v1; +drop table t1; # ------------------------------------------------------------------ # -- End of 5.0 tests # ------------------------------------------------------------------ diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index b53b49bd0dd..1bb07534a7f 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -1519,4 +1519,9 @@ SELECT f1 FROM t1; f1 99999999999999999999999999999.999999999999999999999999999999 DROP TABLE t1; +select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * +1.01500000 * 1.01500000 * 0.99500000); +(1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * +1.01500000 * 1.01500000 * 0.99500000) +0.812988073953673124592306939480 End of 5.0 tests diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 9e7548a21ed..2d98c51a548 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1750,4 +1750,26 @@ DROP TABLE t1; CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://'; DROP TABLE t1; + +# +# Bug #34779: crash in checksum table on federated tables with blobs +# containing nulls +# +connection slave; +CREATE TABLE t1 (a LONGBLOB, b LONGBLOB); +INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL); +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE t1 + (a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +CHECKSUM TABLE t1; +connection slave; +DROP TABLE t1; +connection master; +DROP TABLE t1; + + source include/federated_cleanup.inc; + +--echo End of 5.0 tests diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index cae3c3e157c..f4e0b906f60 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -844,4 +844,24 @@ show status like 'slow_queries'; # show variables like 'myisam_recover_options'; +# +# Bug#37301 Length and Max_length differ with no obvious reason +# +CREATE TABLE t1 ( + Codigo int(10) unsigned NOT NULL auto_increment, + Nombre varchar(255) default NULL, + Telefono varchar(255) default NULL, + Observaciones longtext, + Direccion varchar(255) default NULL, + Dni varchar(255) default NULL, + CP int(11) default NULL, + Provincia varchar(255) default NULL, + Poblacion varchar(255) default NULL, + PRIMARY KEY (Codigo) +) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +--enable_metadata +show create table t1; +--disable_metadata +drop table t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 48ef51e09aa..87ab1d2f0d9 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -7794,6 +7794,30 @@ drop function func30787; drop table t1; +# +# Bug#38291 memory corruption and server crash with view/sp/function +# + +create table t1(c1 INT); +create function f1(p1 int) returns varchar(32) + return 'aaa'; +create view v1 as select f1(c1) as parent_control_name from t1; + +delimiter //; +create procedure p1() +begin + select parent_control_name as c1 from v1; +end // +delimiter ;// + +call p1(); +call p1(); + +drop procedure p1; +drop function f1; +drop view v1; +drop table t1; + --echo # ------------------------------------------------------------------ --echo # -- End of 5.0 tests --echo # ------------------------------------------------------------------ diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index cb7e0c4163a..c44abdb144e 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -1216,4 +1216,13 @@ DESC t1; SELECT f1 FROM t1; DROP TABLE t1; +# +# Bug #36270: incorrect calculation result - works in 4.1 but not in 5.0 or 5.1 +# + +# show that if we need to truncate the scale of an operand, we pick the +# right one (that is, we discard the least significant decimal places) +select (1.20396873 * 0.89550000 * 0.68000000 * 1.08721696 * 0.99500000 * + 1.01500000 * 1.01500000 * 0.99500000); + --echo End of 5.0 tests diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c index 915c11ec51d..0157a65311a 100644 --- a/mysys/mf_pack.c +++ b/mysys/mf_pack.c @@ -343,7 +343,7 @@ uint unpack_dirname(my_string to, const char *from) length-=(uint) (suffix-buff)-1; if (length+(h_length= (uint) strlen(tilde_expansion)) <= FN_REFLEN) { - if (tilde_expansion[h_length-1] == FN_LIBCHAR) + if ((h_length > 0) && (tilde_expansion[h_length-1] == FN_LIBCHAR)) h_length--; if (buff+h_length < suffix) bmove(buff+h_length,suffix,length); diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools index 14422ea5a3f..8cca00d142f 100755 --- a/netware/BUILD/compile-linux-tools +++ b/netware/BUILD/compile-linux-tools @@ -53,6 +53,9 @@ make # so the file will be linked (cd sql; make sql_yacc.cc) +# we need initilizing SQL files. +(cd netware; make test_db.sql init_db.sql) + # copying required linux tools cp extra/comp_err extra/comp_err.linux cp libmysql/conf_to_src libmysql/conf_to_src.linux diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index e0c0b926619..7ea8b9fc4b8 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -91,8 +91,8 @@ done echo "starting build..." # check for bk and repo_dir -bk help > /dev/null -repo_dir=`bk root $repo_dir` +bzr help > /dev/null +repo_dir=`bzr root $repo_dir` cd $repo_dir doc_dir="$repo_dir/../mysqldoc" @@ -100,7 +100,7 @@ doc_dir="$repo_dir/../mysqldoc" temp_dir="$build_dir/mysql-$$.tmp" # export the bk tree -command="bk export"; +command="bzr export"; if test $revision; then command="$command -r$revision"; fi command="$command $temp_dir" echo "exporting $repo_dir..." @@ -178,6 +178,8 @@ awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {pri # build linux tools echo "compiling linux tools..." ./netware/BUILD/compile-linux-tools +test -f ./netware/init_db.sql # this must exist +test -f ./netware/test_db.sql # this must exist # compile if test $build diff --git a/netware/Makefile.am b/netware/Makefile.am index 2e9ff2b59d6..7ad045d433d 100644 --- a/netware/Makefile.am +++ b/netware/Makefile.am @@ -103,8 +103,7 @@ init_db.sql: $(top_srcdir)/scripts/mysql_system_tables.sql \ @echo "CREATE DATABASE mysql;" > $@; @echo "CREATE DATABASE test;" >> $@; @echo "use mysql;" >> $@; - @cat $(top_srcdir)/scripts/mysql_system_tables.sql \ - $(top_srcdir)/scripts/mysql_system_tables_fix.sql >> $@; + @cat $(top_srcdir)/scripts/mysql_system_tables.sql >> $@; # Build test_db.sql from init_db.sql plus # some test data diff --git a/netware/mysql_install_db.c b/netware/mysql_install_db.c index 65ee7873e5c..218c5024a8c 100644 --- a/netware/mysql_install_db.c +++ b/netware/mysql_install_db.c @@ -324,9 +324,10 @@ void create_paths() ******************************************************************************/ int mysql_install_db(int argc, char *argv[]) { - arg_list_t al; - int i, j, err; - char skip; + arg_list_t al; + int i, j, err; + char skip; + struct stat info; // private options static char *private_options[] = @@ -363,6 +364,15 @@ int mysql_install_db(int argc, char *argv[]) add_arg(&al, "--skip-innodb"); add_arg(&al, "--skip-bdb"); + if ((err = stat(sql_file, &info)) != 0) + { + printf("ERROR - %s:\n", strerror(errno)); + printf("\t%s\n\n", sql_file); + // free args + free_args(&al); + exit(-1); + } + // spawn mysqld err = spawn(mysqld, &al, TRUE, sql_file, out_log, err_log); @@ -395,9 +405,9 @@ int main(int argc, char **argv) // install the database if (mysql_install_db(argc, argv)) { - printf("ERROR - The database creation failed!\n"); + printf("ERROR - Failed to create the database!\n"); printf(" %s\n", strerror(errno)); - printf("See the following log for more infomration:\n"); + printf("See the following log for more information:\n"); printf("\t%s\n\n", err_log); exit(-1); } diff --git a/sql/ha_federated.cc b/sql/ha_federated.cc index 9ce5d44534e..b4788dd9c87 100644 --- a/sql/ha_federated.cc +++ b/sql/ha_federated.cc @@ -731,7 +731,10 @@ uint ha_federated::convert_row_to_internal_format(byte *record, old_ptr= (my_ptrdiff_t) (record - table->record[0]); (*field)->move_field(old_ptr); if (!row[x]) + { (*field)->set_null(); + (*field)->reset(); + } else { (*field)->set_notnull(); diff --git a/sql/item.cc b/sql/item.cc index a5c88f55487..100ec8b5cfb 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -5764,6 +5764,10 @@ void Item_ref::make_field(Send_field *field) field->table_name= table_name; if (db_name) field->db_name= db_name; + if (orig_field_name) + field->org_col_name= orig_field_name; + if (orig_table_name) + field->org_table_name= orig_table_name; } diff --git a/sql/item.h b/sql/item.h index 126730bb892..250bb3f67ef 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1817,7 +1817,7 @@ class Item_empty_string :public Item_string public: Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : Item_string("",0, cs ? cs : &my_charset_utf8_general_ci) - { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } + { name=(char*) header; max_length= length * collation.collation->mbmaxlen; } void make_field(Send_field *field); }; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index a80319785bd..c30e0a00d95 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -3666,12 +3666,10 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list) /* Don't let unimplemented types pass through. Could be a grave error. */ DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING); - /* this should be changed when Item_empty_string is fixed(in 4.1) */ - if (!(item= new Item_empty_string("", 0, cs))) + if (!(item= new Item_empty_string("", fields_info->field_length, cs))) { DBUG_RETURN(0); } - item->max_length= fields_info->field_length * cs->mbmaxlen; item->set_name(fields_info->field_name, strlen(fields_info->field_name), cs); break; diff --git a/strings/decimal.c b/strings/decimal.c index 3176cf6afa7..8b431ad9bab 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1999,18 +1999,18 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) sanity(to); - i=intg0; + i=intg0; /* save 'ideal' values */ j=frac0; - FIX_INTG_FRAC_ERROR(to->len, intg0, frac0, error); + FIX_INTG_FRAC_ERROR(to->len, intg0, frac0, error); /* bound size */ to->sign=from1->sign != from2->sign; - to->frac=from1->frac+from2->frac; + to->frac=from1->frac+from2->frac; /* store size in digits */ to->intg=intg0*DIG_PER_DEC1; if (unlikely(error)) { set_if_smaller(to->frac, frac0*DIG_PER_DEC1); set_if_smaller(to->intg, intg0*DIG_PER_DEC1); - if (unlikely(i > intg0)) + if (unlikely(i > intg0)) /* bounded integer-part */ { i-=intg0; j=i >> 1; @@ -2018,12 +2018,20 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to) intg2-=i-j; frac1=frac2=0; /* frac0 is already 0 here */ } - else + else /* bounded fract part */ { j-=frac0; i=j >> 1; - frac1-= i; - frac2-=j-i; + if (frac1 <= frac2) + { + frac1-= i; + frac2-=j-i; + } + else + { + frac2-= i; + frac1-=j-i; + } } } start0=to->buf+intg0+frac0-1; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index ac5473a1ccd..9270a2a9d60 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -7578,9 +7578,7 @@ static void test_explain_bug() else { verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_VAR_STRING, "", - "", "", - NAME_LEN*MAX_KEY / my_charset_utf8_general_ci.mbmaxlen, - 0); + "", "", NAME_LEN*MAX_KEY, 0); } verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING, @@ -16164,7 +16162,7 @@ static void test_bug32265() metadata= mysql_stmt_result_metadata(stmt); field= mysql_fetch_field(metadata); DIE_UNLESS(strcmp(field->table, "v1") == 0); - DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->org_table, "v1") == 0); DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); mysql_free_result(metadata); mysql_stmt_close(stmt); @@ -16176,7 +16174,7 @@ static void test_bug32265() metadata= mysql_stmt_result_metadata(stmt); field= mysql_fetch_field(metadata); DIE_UNLESS(strcmp(field->table, "v1") == 0); - DIE_UNLESS(strcmp(field->org_table, "t1") == 0); + DIE_UNLESS(strcmp(field->org_table, "v1") == 0); DIE_UNLESS(strcmp(field->db, "client_test_db") == 0); mysql_free_result(metadata); mysql_stmt_close(stmt); |