Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
41c7aece
Commit
41c7aece
authored
Jul 06, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test case with views for bug 18243 (see also func_str.test).
parent
cba001b7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
mysql-test/r/view.result
mysql-test/r/view.result
+13
-0
mysql-test/t/view.test
mysql-test/t/view.test
+16
-0
No files found.
mysql-test/r/view.result
View file @
41c7aece
...
@@ -2750,3 +2750,16 @@ a b
...
@@ -2750,3 +2750,16 @@ a b
0 2
0 2
DROP VIEW v1;
DROP VIEW v1;
DROP TABLE t1;
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;
mysql-test/t/view.test
View file @
41c7aece
...
@@ -2614,3 +2614,19 @@ SELECT * FROM t1;
...
@@ -2614,3 +2614,19 @@ SELECT * FROM t1;
DROP
VIEW
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment