From: Date: August 21 2008 7:56pm Subject: bzr push into mysql-5.0 branch (kgeorge:2670 to 2671) Bug#38291 List-Archive: http://lists.mysql.com/commits/52246 X-Bug: 38291 Message-Id: <200808211756.m7LHulRA017867@magare.gmz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2671 Sergey Glukhov 2008-08-20 Bug#38291 memory corruption and server crash with view/sp/function Send_field.org_col_name has broken value on secondary execution. It happens when result field is created from the field which belongs to view due to forgotten assignment of some Send_field attributes. The fix: set Send_field.org_col_name,org_table_name with correct value during Send_field intialization. modified: mysql-test/r/metadata.result mysql-test/r/sp.result mysql-test/t/sp.test sql/item.cc tests/mysql_client_test.c 2670 Georgi Kodinov 2008-08-19 [merge] merged 5.0-main to 5.0-bugteam added: mysql-test/r/innodb-autoinc-optimize.result mysql-test/r/innodb_bug35220.result mysql-test/t/innodb-autoinc-optimize.test mysql-test/t/innodb_bug35220.test modified: configure.in innobase/buf/buf0buf.c innobase/dict/dict0dict.c innobase/include/buf0buf.h innobase/include/srv0srv.h innobase/include/trx0undo.h innobase/srv/srv0srv.c innobase/trx/trx0trx.c innobase/trx/trx0undo.c sql/ha_innodb.cc === modified file 'BUILD/check-cpu' --- a/BUILD/check-cpu 2007-05-29 10:25:51 +0000 +++ b/BUILD/check-cpu 2008-08-18 17:28:46 +0000 @@ -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 === modified file 'mysql-test/r/federated.result' --- a/mysql-test/r/federated.result 2008-03-20 15:07:17 +0000 +++ b/mysql-test/r/federated.result 2008-08-15 06:40:05 +0000 @@ -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@stripped: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 === modified file 'mysql-test/r/metadata.result' --- a/mysql-test/r/metadata.result 2007-06-20 09:21:48 +0000 +++ b/mysql-test/r/metadata.result 2008-08-20 09:49:28 +0000 @@ -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 === modified file 'mysql-test/r/ps_1general.result' --- a/mysql-test/r/ps_1general.result 2007-09-20 08:54:46 +0000 +++ b/mysql-test/r/ps_1general.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/ps_2myisam.result' --- a/mysql-test/r/ps_2myisam.result 2007-12-06 07:46:01 +0000 +++ b/mysql-test/r/ps_2myisam.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/ps_3innodb.result' --- a/mysql-test/r/ps_3innodb.result 2007-12-06 07:46:01 +0000 +++ b/mysql-test/r/ps_3innodb.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/ps_4heap.result' --- a/mysql-test/r/ps_4heap.result 2007-12-06 07:46:01 +0000 +++ b/mysql-test/r/ps_4heap.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/ps_5merge.result' --- a/mysql-test/r/ps_5merge.result 2007-12-06 07:46:01 +0000 +++ b/mysql-test/r/ps_5merge.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/ps_6bdb.result' --- a/mysql-test/r/ps_6bdb.result 2007-12-06 07:46:01 +0000 +++ b/mysql-test/r/ps_6bdb.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/ps_7ndb.result' --- a/mysql-test/r/ps_7ndb.result 2007-12-06 07:46:01 +0000 +++ b/mysql-test/r/ps_7ndb.result 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/r/show_check.result' --- a/mysql-test/r/show_check.result 2007-09-20 08:54:46 +0000 +++ b/mysql-test/r/show_check.result 2008-08-15 20:13:27 +0000 @@ -12,51 +12,51 @@ insert into t1 values (1,2,2),(2,2,3),(3 -- 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 -- 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 -- 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 ---------------------------------------------------------------- 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 */ s ---------------------------------------------------------------- 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 SELEC ---------------------------------------------------------------- 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 === modified file 'mysql-test/r/sp.result' --- a/mysql-test/r/sp.result 2008-02-17 11:37:39 +0000 +++ b/mysql-test/r/sp.result 2008-08-20 09:49:28 +0000 @@ -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 # ------------------------------------------------------------------ === modified file 'mysql-test/r/type_newdecimal.result' --- a/mysql-test/r/type_newdecimal.result 2007-11-17 18:05:31 +0000 +++ b/mysql-test/r/type_newdecimal.result 2008-08-15 19:46:21 +0000 @@ -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 === modified file 'mysql-test/t/federated.test' --- a/mysql-test/t/federated.test 2008-03-25 08:47:57 +0000 +++ b/mysql-test/t/federated.test 2008-08-15 06:40:05 +0000 @@ -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@stripped:$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 === modified file 'mysql-test/t/show_check.test' --- a/mysql-test/t/show_check.test 2007-08-02 13:23:23 +0000 +++ b/mysql-test/t/show_check.test 2008-08-15 20:13:27 +0000 @@ -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 === modified file 'mysql-test/t/sp.test' --- a/mysql-test/t/sp.test 2008-02-17 11:37:39 +0000 +++ b/mysql-test/t/sp.test 2008-08-20 09:49:28 +0000 @@ -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 # ------------------------------------------------------------------ === modified file 'mysql-test/t/type_newdecimal.test' --- a/mysql-test/t/type_newdecimal.test 2007-11-17 18:05:31 +0000 +++ b/mysql-test/t/type_newdecimal.test 2008-08-15 19:46:21 +0000 @@ -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 === modified file 'mysys/mf_pack.c' --- a/mysys/mf_pack.c 2008-07-16 22:58:45 +0000 +++ b/mysys/mf_pack.c 2008-08-18 17:06:27 +0000 @@ -343,7 +343,7 @@ uint unpack_dirname(my_string to, const 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); === modified file 'netware/BUILD/compile-linux-tools' --- a/netware/BUILD/compile-linux-tools 2006-04-03 15:54:09 +0000 +++ b/netware/BUILD/compile-linux-tools 2008-08-06 13:25:03 +0000 @@ -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 === modified file 'netware/BUILD/nwbootstrap' --- a/netware/BUILD/nwbootstrap 2006-11-28 17:36:53 +0000 +++ b/netware/BUILD/nwbootstrap 2008-08-06 13:25:03 +0000 @@ -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== # 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 === modified file 'netware/Makefile.am' --- a/netware/Makefile.am 2007-08-24 21:40:36 +0000 +++ b/netware/Makefile.am 2008-08-06 13:25:03 +0000 @@ -103,8 +103,7 @@ init_db.sql: $(top_srcdir)/scripts/mysql @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 === modified file 'netware/mysql_install_db.c' --- a/netware/mysql_install_db.c 2006-04-03 01:37:43 +0000 +++ b/netware/mysql_install_db.c 2008-08-06 13:25:03 +0000 @@ -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 *arg 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); } === modified file 'sql/ha_federated.cc' --- a/sql/ha_federated.cc 2008-07-17 14:33:41 +0000 +++ b/sql/ha_federated.cc 2008-08-15 06:40:05 +0000 @@ -731,7 +731,10 @@ uint ha_federated::convert_row_to_intern 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(); === modified file 'sql/item.cc' --- a/sql/item.cc 2008-07-30 11:07:37 +0000 +++ b/sql/item.cc 2008-08-20 09:49:28 +0000 @@ -5764,6 +5764,10 @@ void Item_ref::make_field(Send_field *fi 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; } === modified file 'sql/item.h' --- a/sql/item.h 2008-08-11 16:10:00 +0000 +++ b/sql/item.h 2008-08-15 20:13:27 +0000 @@ -1817,7 +1817,7 @@ class Item_empty_string :public Item_str 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); }; === modified file 'sql/sql_show.cc' --- a/sql/sql_show.cc 2008-03-19 13:32:28 +0000 +++ b/sql/sql_show.cc 2008-08-15 20:13:27 +0000 @@ -3666,12 +3666,10 @@ TABLE *create_schema_table(THD *thd, TAB /* 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; === modified file 'strings/decimal.c' --- a/strings/decimal.c 2008-01-14 15:16:36 +0000 +++ b/strings/decimal.c 2008-08-15 19:46:21 +0000 @@ -1999,18 +1999,18 @@ int decimal_mul(decimal_t *from1, decima 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, decima 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; === modified file 'tests/mysql_client_test.c' --- a/tests/mysql_client_test.c 2008-08-11 23:27:09 +0000 +++ b/tests/mysql_client_test.c 2008-08-20 09:49:28 +0000 @@ -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);