Added a test case with views for bug 18243 (see also func_str.test).

This commit is contained in:
unknown 2006-07-06 14:41:01 -07:00
parent cba001b77a
commit 41c7aece39
2 changed files with 29 additions and 0 deletions

View File

@ -2750,3 +2750,16 @@ a b
0 2
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (firstname text, surname text);
INSERT INTO t1 VALUES
("Bart","Simpson"),("Milhouse","van Houten"),("Montgomery","Burns");
CREATE VIEW v1 AS SELECT CONCAT(firstname," ",surname) AS name FROM t1;
SELECT CONCAT(LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," ")),
LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," "))) AS f1
FROM v1;
f1
BartBart
Milhouse vanMilhouse van
MontgomeryMontgomery
DROP VIEW v1;
DROP TABLE t1;

View File

@ -2614,3 +2614,19 @@ SELECT * FROM t1;
DROP VIEW v1;
DROP TABLE t1;
#
# Bug #18243: expression over a view column that with the REVERSE function
#
CREATE TABLE t1 (firstname text, surname text);
INSERT INTO t1 VALUES
("Bart","Simpson"),("Milhouse","van Houten"),("Montgomery","Burns");
CREATE VIEW v1 AS SELECT CONCAT(firstname," ",surname) AS name FROM t1;
SELECT CONCAT(LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," ")),
LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," "))) AS f1
FROM v1;
DROP VIEW v1;
DROP TABLE t1;