Loading BitKeeper/etc/collapsed +2 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,5 @@ 45214442pBGT9KuZEGixBH71jTzbOA 45214a07hVsIGwvwa-WrO-jpeaSwVw 452a92d0-31-8wSzSfZi165fcGcXPA 454a7ef8gdvE_ddMlJyghvOAkKPNOQ 454f8960jsVT_kMKJtZ9OCgXoba0xQ mysql-test/r/func_test.result +75 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,81 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; 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 select (12%0) <=> null as '1'; 1 1 select (12%0) is null as '1'; 1 1 select 12%0 as 'NULL'; NULL NULL select 12%2 as '0'; 0 0 select 12%NULL as 'NULL'; NULL NULL select 12 % null as 'NULL'; NULL NULL select null % 12 as 'NULL'; NULL NULL select null % 0 as 'NULL'; NULL NULL select 0 % null as 'NULL'; NULL NULL select null % null as 'NULL'; NULL NULL select (12 mod 0) <=> null as '1'; 1 1 select (12 mod 0) is null as '1'; 1 1 select 12 mod 0 as 'NULL'; NULL NULL select 12 mod 2 as '0'; 0 0 select 12 mod null as 'NULL'; NULL NULL select null mod 12 as 'NULL'; NULL NULL select null mod 0 as 'NULL'; NULL NULL select 0 mod null as 'NULL'; NULL NULL select null mod null as 'NULL'; NULL NULL select mod(12.0, 0) as 'NULL'; NULL NULL select mod(12, 0.0) as 'NULL'; NULL NULL select mod(12, NULL) as 'NULL'; NULL NULL select mod(12.0, NULL) as 'NULL'; NULL NULL select mod(NULL, 2) as 'NULL'; NULL NULL select mod(NULL, 2.0) as 'NULL'; NULL NULL create table t1 (a int, b int); insert into t1 values (1,2), (2,3), (3,4), (4,5); select * from t1 where a not between 1 and 2; Loading mysql-test/r/rpl_view.result +2 −2 Original line number Diff line number Diff line Loading @@ -47,11 +47,11 @@ show binlog events limit 1,100; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query 1 # use `test`; create table t1 (a int) slave-bin.000001 # Query 1 # use `test`; insert into t1 values (1) slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a from t1 slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a from t1 slave-bin.000001 # Query 1 # use `test`; insert into v1 values (2) slave-bin.000001 # Query 1 # use `test`; update v1 set a=3 where a=1 slave-bin.000001 # Query 1 # use `test`; delete from v1 where a=2 slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a as b from t1 slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a as b from t1 slave-bin.000001 # Query 1 # use `test`; drop view v1 slave-bin.000001 # Query 1 # use `test`; drop table t1 Loading mysql-test/t/func_test.test +34 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,40 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; # # Bug#23411: The "%" (MOD) operator is not documented; MOD-ing zero returns strange result # Manual: "Division by zero produces a NULL result" # select (12%0) <=> null as '1'; select (12%0) is null as '1'; select 12%0 as 'NULL'; select 12%2 as '0'; select 12%NULL as 'NULL'; select 12 % null as 'NULL'; select null % 12 as 'NULL'; select null % 0 as 'NULL'; select 0 % null as 'NULL'; select null % null as 'NULL'; select (12 mod 0) <=> null as '1'; select (12 mod 0) is null as '1'; select 12 mod 0 as 'NULL'; select 12 mod 2 as '0'; select 12 mod null as 'NULL'; select null mod 12 as 'NULL'; select null mod 0 as 'NULL'; select 0 mod null as 'NULL'; select null mod null as 'NULL'; select mod(12.0, 0) as 'NULL'; select mod(12, 0.0) as 'NULL'; select mod(12, NULL) as 'NULL'; select mod(12.0, NULL) as 'NULL'; select mod(NULL, 2) as 'NULL'; select mod(NULL, 2.0) as 'NULL'; # # Bug#6726: NOT BETWEEN parse failure # create table t1 (a int, b int); Loading sql/item_func.cc +8 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ Item_func::Item_func(THD *thd, Item_func *item) /* Resolve references to table column for a function and it's argument Resolve references to table column for a function and its argument SYNOPSIS: fix_fields() Loading Loading @@ -1377,6 +1377,13 @@ void Item_func_mod::result_precision() } void Item_func_mod::fix_length_and_dec() { Item_num_op::fix_length_and_dec(); maybe_null= 1; } double Item_func_neg::real_op() { double value= args[0]->val_real(); Loading Loading
BitKeeper/etc/collapsed +2 −0 Original line number Diff line number Diff line Loading @@ -15,3 +15,5 @@ 45214442pBGT9KuZEGixBH71jTzbOA 45214a07hVsIGwvwa-WrO-jpeaSwVw 452a92d0-31-8wSzSfZi165fcGcXPA 454a7ef8gdvE_ddMlJyghvOAkKPNOQ 454f8960jsVT_kMKJtZ9OCgXoba0xQ
mysql-test/r/func_test.result +75 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,81 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; 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 select (12%0) <=> null as '1'; 1 1 select (12%0) is null as '1'; 1 1 select 12%0 as 'NULL'; NULL NULL select 12%2 as '0'; 0 0 select 12%NULL as 'NULL'; NULL NULL select 12 % null as 'NULL'; NULL NULL select null % 12 as 'NULL'; NULL NULL select null % 0 as 'NULL'; NULL NULL select 0 % null as 'NULL'; NULL NULL select null % null as 'NULL'; NULL NULL select (12 mod 0) <=> null as '1'; 1 1 select (12 mod 0) is null as '1'; 1 1 select 12 mod 0 as 'NULL'; NULL NULL select 12 mod 2 as '0'; 0 0 select 12 mod null as 'NULL'; NULL NULL select null mod 12 as 'NULL'; NULL NULL select null mod 0 as 'NULL'; NULL NULL select 0 mod null as 'NULL'; NULL NULL select null mod null as 'NULL'; NULL NULL select mod(12.0, 0) as 'NULL'; NULL NULL select mod(12, 0.0) as 'NULL'; NULL NULL select mod(12, NULL) as 'NULL'; NULL NULL select mod(12.0, NULL) as 'NULL'; NULL NULL select mod(NULL, 2) as 'NULL'; NULL NULL select mod(NULL, 2.0) as 'NULL'; NULL NULL create table t1 (a int, b int); insert into t1 values (1,2), (2,3), (3,4), (4,5); select * from t1 where a not between 1 and 2; Loading
mysql-test/r/rpl_view.result +2 −2 Original line number Diff line number Diff line Loading @@ -47,11 +47,11 @@ show binlog events limit 1,100; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query 1 # use `test`; create table t1 (a int) slave-bin.000001 # Query 1 # use `test`; insert into t1 values (1) slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a from t1 slave-bin.000001 # Query 1 # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a from t1 slave-bin.000001 # Query 1 # use `test`; insert into v1 values (2) slave-bin.000001 # Query 1 # use `test`; update v1 set a=3 where a=1 slave-bin.000001 # Query 1 # use `test`; delete from v1 where a=2 slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=root@localhost SQL SECURITY DEFINER VIEW v1 AS select a as b from t1 slave-bin.000001 # Query 1 # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select a as b from t1 slave-bin.000001 # Query 1 # use `test`; drop view v1 slave-bin.000001 # Query 1 # use `test`; drop table t1 Loading
mysql-test/t/func_test.test +34 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,40 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; # # Bug#23411: The "%" (MOD) operator is not documented; MOD-ing zero returns strange result # Manual: "Division by zero produces a NULL result" # select (12%0) <=> null as '1'; select (12%0) is null as '1'; select 12%0 as 'NULL'; select 12%2 as '0'; select 12%NULL as 'NULL'; select 12 % null as 'NULL'; select null % 12 as 'NULL'; select null % 0 as 'NULL'; select 0 % null as 'NULL'; select null % null as 'NULL'; select (12 mod 0) <=> null as '1'; select (12 mod 0) is null as '1'; select 12 mod 0 as 'NULL'; select 12 mod 2 as '0'; select 12 mod null as 'NULL'; select null mod 12 as 'NULL'; select null mod 0 as 'NULL'; select 0 mod null as 'NULL'; select null mod null as 'NULL'; select mod(12.0, 0) as 'NULL'; select mod(12, 0.0) as 'NULL'; select mod(12, NULL) as 'NULL'; select mod(12.0, NULL) as 'NULL'; select mod(NULL, 2) as 'NULL'; select mod(NULL, 2.0) as 'NULL'; # # Bug#6726: NOT BETWEEN parse failure # create table t1 (a int, b int); Loading
sql/item_func.cc +8 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ Item_func::Item_func(THD *thd, Item_func *item) /* Resolve references to table column for a function and it's argument Resolve references to table column for a function and its argument SYNOPSIS: fix_fields() Loading Loading @@ -1377,6 +1377,13 @@ void Item_func_mod::result_precision() } void Item_func_mod::fix_length_and_dec() { Item_num_op::fix_length_and_dec(); maybe_null= 1; } double Item_func_neg::real_op() { double value= args[0]->val_real(); Loading