diff options
author | unknown <gkodinov/kgeorge@magare.gmz> | 2007-04-11 13:58:16 +0300 |
---|---|---|
committer | unknown <gkodinov/kgeorge@magare.gmz> | 2007-04-11 13:58:16 +0300 |
commit | 8fe487beba161e6290d9e063efc4c3019c9ed412 (patch) | |
tree | 0a97cb5f90abe79b4947662dc3c9c5083ec4be81 /mysql-test/t/func_str.test | |
parent | b518d2a8bd328f9bb985b211382a97e55059a92c (diff) | |
download | mariadb-git-8fe487beba161e6290d9e063efc4c3019c9ed412.tar.gz |
Bug #27530:
The function CRC32() returns unsigned integer.
But the metadata (the unsigned flag) for the
function was set incorrectly.
As a result type arithmetics based on the
function's metadata (like finding the concise
type of an temporary table column to hold the result)
returned incorrect results.
Fixed by returning correct type information.
This fix is based on code contributed by Martin Friebe
(martin@hybyte.com) on 2007-03-30.
mysql-test/r/func_str.result:
Bug #27530: test case
mysql-test/t/func_str.test:
Bug #27530: test case
sql/item_strfunc.h:
Bug #27530: Marked CRC32() as returning unsigned
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r-- | mysql-test/t/func_str.test | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 0e4b404fe3a..bca977e6df3 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1058,4 +1058,22 @@ SELECT INSERT('abc', 4, 3, '1234'); SELECT INSERT('abc', 5, 3, '1234'); SELECT INSERT('abc', 6, 3, '1234'); +# +# Bug #27530: Grouping on crc32, or create table select crc32 +# +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT CRC32(a) AS C FROM t1; + +INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1; +SELECT CRC32(a), COUNT(*) FROM t1 GROUP BY 1 ORDER BY 1; +SELECT * FROM (SELECT CRC32(a) FROM t1) t2; +CREATE TABLE t2 SELECT CRC32(a) FROM t1; +desc t2; +SELECT * FROM v1; +SELECT * FROM (SELECT * FROM v1) x; + +DROP TABLE t1, t2; +DROP VIEW v1; + --echo End of 5.0 tests |