diff options
author | unknown <gshchepa/uchum@gleb.loc> | 2007-11-18 00:02:55 +0400 |
---|---|---|
committer | unknown <gshchepa/uchum@gleb.loc> | 2007-11-18 00:02:55 +0400 |
commit | 8aa822ee5cf0221a6444ab5f5a2b106beb0bda38 (patch) | |
tree | acce2ade0392c10725743341a35697fc72c70260 /mysql-test/t/select.test | |
parent | a3d78175291c294ecc63449b8ba1dced48676d1d (diff) | |
download | mariadb-git-8aa822ee5cf0221a6444ab5f5a2b106beb0bda38.tar.gz |
Fixed bug #32335.
Comparison of a BIGINT NOT NULL column with a constant arithmetic
expression that evaluates to NULL caused error 1048: "Column '...'
cannot be null".
Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in a
NOT NULL field caused query errors.
sql/item_cmpfunc.cc:
Fixed bug #32335.
1. Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in
a NOT NULL field caused query errors.
2. Also minor bug has been fixed: the thd->count_cuted_fields value
was not restored in case of successful conversion.
mysql-test/t/select.test:
Added test case for bug #32335.
mysql-test/r/select.result:
Added test case for bug #32335.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r-- | mysql-test/t/select.test | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 31c8a3f7d11..c48f2771aa8 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -3661,4 +3661,15 @@ DROP TABLE t2; ########################################################################### +# +# Bug #32335: Error on BIGINT > NULL + 1 +# + +CREATE TABLE t1 (c1 BIGINT NOT NULL); +INSERT INTO t1 (c1) VALUES (1); +SELECT * FROM t1 WHERE c1 > NULL + 1; +DROP TABLE t1; + +--echo + --echo End of 5.0 tests |