Loading mysql-test/r/func_test.result +9 −0 Original line number Diff line number Diff line Loading @@ -174,3 +174,12 @@ SELECT GREATEST(d,d) FROM t1 WHERE k=2; GREATEST(d,d) NULL DROP TABLE t1; select 1197.90 mod 50; 1197.90 mod 50 47.90 select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; 5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3 2.1 2.1 -2.1 -2.1 select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; 5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 2 2 -2 -2 mysql-test/r/ps_10nestset.result +8 −11 Original line number Diff line number Diff line use test; drop table if exists personnel; Warnings: Note 1051 Unknown table 'personnel' create table personnel ( drop table if exists t1; create table t1 ( id INTEGER AUTO_INCREMENT PRIMARY KEY, emp CHAR(10) NOT NULL, salary DECIMAL(6,2) NOT NULL, l INTEGER NOT NULL, r INTEGER NOT NULL); prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?'; set @arg_nam= 'Jerry'; set @arg_sal= 1000; set @arg_l= 1; Loading Loading @@ -39,7 +36,7 @@ set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; select * from personnel; select * from t1; id emp salary l r 1 Jerry 1000.00 1 12 2 Bert 900.00 2 3 Loading @@ -47,8 +44,8 @@ id emp salary l r 4 Donna 800.00 5 6 5 Eddie 700.00 7 8 6 Fred 600.00 9 10 prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1'; set @arg_percent= .10; set @arg_amount= 100; execute st_raise_base using @arg_percent; Loading @@ -57,7 +54,7 @@ execute st_raise_base using @arg_percent; execute st_raise_mgr using @arg_amount; execute st_raise_base using @arg_percent; execute st_raise_mgr using @arg_amount; select * from personnel; select * from t1; id emp salary l r 1 Jerry 1300.00 1 12 2 Bert 1197.90 2 3 Loading @@ -65,4 +62,4 @@ id emp salary l r 4 Donna 1064.80 5 6 5 Eddie 931.70 7 8 6 Fred 798.60 9 10 drop table personnel; drop table t1; mysql-test/t/func_test.test +13 −0 Original line number Diff line number Diff line Loading @@ -94,3 +94,16 @@ CREATE TABLE t1 (d varchar(6), k int); INSERT INTO t1 VALUES (NULL, 2); SELECT GREATEST(d,d) FROM t1 WHERE k=2; DROP TABLE t1; # # Bug #6138: mod and doubles # select 1197.90 mod 50; select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; # # Test for mod and signed integers # select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; mysql-test/t/ps_10nestset.test +22 −13 Original line number Diff line number Diff line Loading @@ -8,25 +8,26 @@ # Source: http://kris.koehntopp.de/artikel/sql-self-references (dated 1999) # Source: http://dbmsmag.com/9603d06.html (dated 1996) use test; drop table if exists personnel; --disable_warnings drop table if exists t1; --enable_warnings # "Nested Set": This table represents an employee list with a hierarchy tree. # The tree is not modeled by "parent" links but rather by showing the "left" # and "right" border of any person's "region". By convention, "l" < "r". # As it is a tree, these "regions" of two persons A and B are either disjoint, # or A's region is completely contained in B's (B is A's boss), or vice versa. # See the references for more info. # or A's region is completely contained in B's (B.l < A.l < A.r < B.r: # B is A's boss), or vice versa. # Any other overlaps violate the model. See the references for more info. create table personnel ( create table t1 ( id INTEGER AUTO_INCREMENT PRIMARY KEY, emp CHAR(10) NOT NULL, salary DECIMAL(6,2) NOT NULL, l INTEGER NOT NULL, r INTEGER NOT NULL); prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?'; # Initial employee list: # Jerry ( Bert () Chuck ( Donna () Eddie () Fred () ) ) Loading @@ -43,11 +44,11 @@ execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; set @arg_nam= 'Fred'; set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; select * from personnel; select * from t1; # Three successive raises, each one is 100 units for managers, 10 percent for others. prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1'; let $1= 3; set @arg_percent= .10; set @arg_amount= 100; Loading @@ -58,6 +59,14 @@ while ($1) dec $1; } select * from personnel; select * from t1; # Waiting for the resolution of bug#6138 # # Now, increase salary to a multiple of 50 # prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; # set @arg_round= 50; # execute st_round using @arg_round, @arg_round; # # select * from t1; drop table personnel; drop table t1; mysql-test/t/ps_11bugs.test +1 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ drop table t1; # end of bug#1644 # bug#1677: Prepared statement two-table join returns no rows when one is expected # bug#1676: Prepared statement two-table join returns no rows when one is expected create table t1( cola varchar(50) not null, Loading Loading
mysql-test/r/func_test.result +9 −0 Original line number Diff line number Diff line Loading @@ -174,3 +174,12 @@ SELECT GREATEST(d,d) FROM t1 WHERE k=2; GREATEST(d,d) NULL DROP TABLE t1; select 1197.90 mod 50; 1197.90 mod 50 47.90 select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; 5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3 2.1 2.1 -2.1 -2.1 select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; 5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 2 2 -2 -2
mysql-test/r/ps_10nestset.result +8 −11 Original line number Diff line number Diff line use test; drop table if exists personnel; Warnings: Note 1051 Unknown table 'personnel' create table personnel ( drop table if exists t1; create table t1 ( id INTEGER AUTO_INCREMENT PRIMARY KEY, emp CHAR(10) NOT NULL, salary DECIMAL(6,2) NOT NULL, l INTEGER NOT NULL, r INTEGER NOT NULL); prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?'; set @arg_nam= 'Jerry'; set @arg_sal= 1000; set @arg_l= 1; Loading Loading @@ -39,7 +36,7 @@ set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; select * from personnel; select * from t1; id emp salary l r 1 Jerry 1000.00 1 12 2 Bert 900.00 2 3 Loading @@ -47,8 +44,8 @@ id emp salary l r 4 Donna 800.00 5 6 5 Eddie 700.00 7 8 6 Fred 600.00 9 10 prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1'; set @arg_percent= .10; set @arg_amount= 100; execute st_raise_base using @arg_percent; Loading @@ -57,7 +54,7 @@ execute st_raise_base using @arg_percent; execute st_raise_mgr using @arg_amount; execute st_raise_base using @arg_percent; execute st_raise_mgr using @arg_amount; select * from personnel; select * from t1; id emp salary l r 1 Jerry 1300.00 1 12 2 Bert 1197.90 2 3 Loading @@ -65,4 +62,4 @@ id emp salary l r 4 Donna 1064.80 5 6 5 Eddie 931.70 7 8 6 Fred 798.60 9 10 drop table personnel; drop table t1;
mysql-test/t/func_test.test +13 −0 Original line number Diff line number Diff line Loading @@ -94,3 +94,16 @@ CREATE TABLE t1 (d varchar(6), k int); INSERT INTO t1 VALUES (NULL, 2); SELECT GREATEST(d,d) FROM t1 WHERE k=2; DROP TABLE t1; # # Bug #6138: mod and doubles # select 1197.90 mod 50; select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; # # Test for mod and signed integers # select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3;
mysql-test/t/ps_10nestset.test +22 −13 Original line number Diff line number Diff line Loading @@ -8,25 +8,26 @@ # Source: http://kris.koehntopp.de/artikel/sql-self-references (dated 1999) # Source: http://dbmsmag.com/9603d06.html (dated 1996) use test; drop table if exists personnel; --disable_warnings drop table if exists t1; --enable_warnings # "Nested Set": This table represents an employee list with a hierarchy tree. # The tree is not modeled by "parent" links but rather by showing the "left" # and "right" border of any person's "region". By convention, "l" < "r". # As it is a tree, these "regions" of two persons A and B are either disjoint, # or A's region is completely contained in B's (B is A's boss), or vice versa. # See the references for more info. # or A's region is completely contained in B's (B.l < A.l < A.r < B.r: # B is A's boss), or vice versa. # Any other overlaps violate the model. See the references for more info. create table personnel ( create table t1 ( id INTEGER AUTO_INCREMENT PRIMARY KEY, emp CHAR(10) NOT NULL, salary DECIMAL(6,2) NOT NULL, l INTEGER NOT NULL, r INTEGER NOT NULL); prepare st_ins from 'insert into personnel set emp = ?, salary = ?, l = ?, r = ?'; prepare st_ins from 'insert into t1 set emp = ?, salary = ?, l = ?, r = ?'; # Initial employee list: # Jerry ( Bert () Chuck ( Donna () Eddie () Fred () ) ) Loading @@ -43,11 +44,11 @@ execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; set @arg_nam= 'Fred'; set @arg_sal= 600; set @arg_l= 9; set @arg_r= 10; execute st_ins using @arg_nam, @arg_sal, @arg_l, @arg_r ; select * from personnel; select * from t1; # Three successive raises, each one is 100 units for managers, 10 percent for others. prepare st_raise_base from 'update personnel set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update personnel set salary = salary + ? where r - l > 1'; prepare st_raise_base from 'update t1 set salary = salary * ( 1 + ? ) where r - l = 1'; prepare st_raise_mgr from 'update t1 set salary = salary + ? where r - l > 1'; let $1= 3; set @arg_percent= .10; set @arg_amount= 100; Loading @@ -58,6 +59,14 @@ while ($1) dec $1; } select * from personnel; select * from t1; # Waiting for the resolution of bug#6138 # # Now, increase salary to a multiple of 50 # prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; # set @arg_round= 50; # execute st_round using @arg_round, @arg_round; # # select * from t1; drop table personnel; drop table t1;
mysql-test/t/ps_11bugs.test +1 −1 Original line number Diff line number Diff line Loading @@ -97,7 +97,7 @@ drop table t1; # end of bug#1644 # bug#1677: Prepared statement two-table join returns no rows when one is expected # bug#1676: Prepared statement two-table join returns no rows when one is expected create table t1( cola varchar(50) not null, Loading