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
8b7fc77a
Commit
8b7fc77a
authored
Jul 19, 2006
by
igor@olga.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test case with views for bug #17526.
parent
d1c109ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
6 deletions
+63
-6
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+5
-5
mysql-test/r/view.result
mysql-test/r/view.result
+33
-0
mysql-test/t/view.test
mysql-test/t/view.test
+24
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+1
-1
No files found.
mysql-test/r/func_str.result
View file @
8b7fc77a
...
...
@@ -1059,27 +1059,27 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(s) > 'ab';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
Warnings:
Note 1003 select
test.t1.s AS `s` from test.t1 where (trim(test.t1.s
) > _latin1'ab')
Note 1003 select
`test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(`test`.`t1`.`s`
) > _latin1'ab')
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM('y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
Warnings:
Note 1003 select
test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s
) > _latin1'ab')
Note 1003 select
`test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`
) > _latin1'ab')
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(LEADING 'y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
Warnings:
Note 1003 select
test.t1.s AS `s` from test.t1 where (trim(leading _latin1'y' from test.t1.s
) > _latin1'ab')
Note 1003 select
`test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(leading _latin1'y' from `test`.`t1`.`s`
) > _latin1'ab')
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(TRAILING 'y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
Warnings:
Note 1003 select
test.t1.s AS `s` from test.t1 where (trim(trailing _latin1'y' from test.t1.s
) > _latin1'ab')
Note 1003 select
`test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(trailing _latin1'y' from `test`.`t1`.`s`
) > _latin1'ab')
EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
Warnings:
Note 1003 select
test.t1.s AS `s` from test.t1 where (trim(both _latin1'y' from test.t1.s
) > _latin1'ab')
Note 1003 select
`test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`
) > _latin1'ab')
DROP TABLE t1;
End of 4.1 tests
create table t1 (d decimal default null);
...
...
mysql-test/r/view.result
View file @
8b7fc77a
...
...
@@ -2774,3 +2774,36 @@ Field Type Null Key Default Extra
COALESCE(i,j) int(11) YES NULL
DROP VIEW v1;
DROP TABLE t1,t2;
CREATE TABLE t1 (s varchar(10));
INSERT INTO t1 VALUES ('yadda'), ('yady');
SELECT TRIM(BOTH 'y' FROM s) FROM t1;
TRIM(BOTH 'y' FROM s)
adda
ad
CREATE VIEW v1 AS SELECT TRIM(BOTH 'y' FROM s) FROM t1;
SELECT * FROM v1;
TRIM(BOTH 'y' FROM s)
adda
ad
DROP VIEW v1;
SELECT TRIM(LEADING 'y' FROM s) FROM t1;
TRIM(LEADING 'y' FROM s)
adda
ady
CREATE VIEW v1 AS SELECT TRIM(LEADING 'y' FROM s) FROM t1;
SELECT * FROM v1;
TRIM(LEADING 'y' FROM s)
adda
ady
DROP VIEW v1;
SELECT TRIM(TRAILING 'y' FROM s) FROM t1;
TRIM(TRAILING 'y' FROM s)
yadda
yad
CREATE VIEW v1 AS SELECT TRIM(TRAILING 'y' FROM s) FROM t1;
SELECT * FROM v1;
TRIM(TRAILING 'y' FROM s)
yadda
yad
DROP VIEW v1;
DROP TABLE t1;
mysql-test/t/view.test
View file @
8b7fc77a
...
...
@@ -2643,3 +2643,27 @@ DESCRIBE t2;
DROP
VIEW
v1
;
DROP
TABLE
t1
,
t2
;
#
# Bug #17526: views with TRIM functions
#
CREATE
TABLE
t1
(
s
varchar
(
10
));
INSERT
INTO
t1
VALUES
(
'yadda'
),
(
'yady'
);
SELECT
TRIM
(
BOTH
'y'
FROM
s
)
FROM
t1
;
CREATE
VIEW
v1
AS
SELECT
TRIM
(
BOTH
'y'
FROM
s
)
FROM
t1
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
SELECT
TRIM
(
LEADING
'y'
FROM
s
)
FROM
t1
;
CREATE
VIEW
v1
AS
SELECT
TRIM
(
LEADING
'y'
FROM
s
)
FROM
t1
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
SELECT
TRIM
(
TRAILING
'y'
FROM
s
)
FROM
t1
;
CREATE
VIEW
v1
AS
SELECT
TRIM
(
TRAILING
'y'
FROM
s
)
FROM
t1
;
SELECT
*
FROM
v1
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
sql/item_strfunc.cc
View file @
8b7fc77a
...
...
@@ -1515,7 +1515,7 @@ void Item_func_trim::print(String *str)
str
->
append
(
mode_name
());
str
->
append
(
' '
);
args
[
1
]
->
print
(
str
);
str
->
append
(
" from "
,
6
);
str
->
append
(
STRING_WITH_LEN
(
" from "
)
);
args
[
0
]
->
print
(
str
);
str
->
append
(
')'
);
}
...
...
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