mirror of
https://github.com/MariaDB/server.git
synced 2025-05-02 19:25:03 +03:00
added test for bug #2290 "output truncated with ELT when using DISTINCT"
This commit is contained in:
parent
f982614ae2
commit
4a668f95ce
@ -266,3 +266,10 @@ CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
|
|||||||
NULL
|
NULL
|
||||||
</a>..........................
|
</a>..........................
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
CREATE TABLE t1 (i int, j int);
|
||||||
|
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||||
|
SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
|
||||||
|
i ELT(j, '345', '34')
|
||||||
|
1 345
|
||||||
|
2 34
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -154,3 +154,12 @@ INSERT INTO t1 VALUES ('House passes the CAREERS bill');
|
|||||||
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
|
SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
|
||||||
|
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# test for Bug #2290 "output truncated with ELT when using DISTINCT"
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (i int, j int);
|
||||||
|
INSERT INTO t1 VALUES (1,1),(2,2);
|
||||||
|
SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
|
||||||
|
DROP TABLE t1;
|
@ -1507,7 +1507,7 @@ void Item_func_elt::fix_length_and_dec()
|
|||||||
{
|
{
|
||||||
max_length=0;
|
max_length=0;
|
||||||
decimals=0;
|
decimals=0;
|
||||||
for (uint i=1 ; i < arg_count ; i++)
|
for (uint i= 0; i < arg_count ; i++) // first number argument isn't in list!
|
||||||
{
|
{
|
||||||
set_if_bigger(max_length,args[i]->max_length);
|
set_if_bigger(max_length,args[i]->max_length);
|
||||||
set_if_bigger(decimals,args[i]->decimals);
|
set_if_bigger(decimals,args[i]->decimals);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user