1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge kaamos.(none):/data/src/opt/bug31236/my51-bug31236

into  kaamos.(none):/data/src/opt/mysql-5.1-opt


configure.in:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/unireg.h:
  Auto merged
This commit is contained in:
unknown
2008-02-20 00:37:51 +03:00
11 changed files with 62 additions and 82 deletions

View File

@ -408,3 +408,22 @@ a DIV 2
0
DROP TABLE t1;
End of 5.0 tests
SELECT 1e308 + 1e308;
1e308 + 1e308
NULL
SELECT -1e308 - 1e308;
-1e308 - 1e308
NULL
SELECT 1e300 * 1e300;
1e300 * 1e300
NULL
SELECT 1e300 / 1e-300;
1e300 / 1e-300
NULL
SELECT EXP(750);
EXP(750)
NULL
SELECT POW(10, 309);
POW(10, 309)
NULL
End of 5.1 tests

View File

@ -895,7 +895,6 @@ ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
ERROR 22003: Out of range value for column 'col2' at row 1
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
ERROR 22003: Out of range value for column 'col1' at row 3
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;
ERROR 22012: Division by 0
UPDATE t1 SET col2= MOD(col2,0) WHERE col2 > 0;
@ -923,10 +922,10 @@ SELECT * FROM t1;
col1 col2
-2.2e-307 0
1e-303 0
1.7e+308 1.7e+308
NULL 1.7e+308
-2.2e-307 0
-2e-307 0
1.7e+308 1.7e+308
NULL 1.7e+308
0 NULL
2 NULL
NULL NULL

View File

@ -248,5 +248,17 @@ INSERT INTO t1 VALUES ('a');
SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
DROP TABLE t1;
--echo End of 5.0 tests
#
# Bug #31236: Inconsistent division by zero behavior for floating point numbers
#
SELECT 1e308 + 1e308;
SELECT -1e308 - 1e308;
SELECT 1e300 * 1e300;
SELECT 1e300 / 1e-300;
SELECT EXP(750);
SELECT POW(10, 309);
--echo End of 5.1 tests

View File

@ -822,7 +822,6 @@ INSERT INTO t1 (col2) VALUES (-1.1E-3);
INSERT INTO t1 (col1) VALUES ('+1.8E+309');
--error 1264
INSERT INTO t1 (col2) VALUES ('-1.2E-3');
--error 1264
UPDATE t1 SET col1 =col1 * 5000 WHERE col1 > 0;
--error 1365
UPDATE t1 SET col2 =col2 / 0 WHERE col2 > 0;