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
895db718
Commit
895db718
authored
May 23, 2003
by
bar@bar.mysql.r18.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge abarkov@build.mysql.com:/home/bk/mysql-4.1
into bar.mysql.r18.ru:/usr/home/bar/mysql-4.1
parents
76feb411
8514caa1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
1 deletion
+68
-1
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+42
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+23
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+3
-1
No files found.
mysql-test/r/func_str.result
View file @
895db718
...
@@ -249,3 +249,45 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
...
@@ -249,3 +249,45 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
1
1
DROP TABLE t1;
DROP TABLE t1;
select collation(lcase(_latin2'a')), coercibility(lcase(_latin2'a'));
collation(lcase(_latin2'a')) coercibility(lcase(_latin2'a'))
latin2_general_ci 3
select collation(ucase(_latin2'a')), coercibility(ucase(_latin2'a'));
collation(ucase(_latin2'a')) coercibility(ucase(_latin2'a'))
latin2_general_ci 3
select collation(left(_latin2'a',1)), coercibility(left(_latin2'a',1));
collation(left(_latin2'a',1)) coercibility(left(_latin2'a',1))
latin2_general_ci 3
select collation(right(_latin2'a',1)), coercibility(right(_latin2'a',1));
collation(right(_latin2'a',1)) coercibility(right(_latin2'a',1))
latin2_general_ci 3
select collation(substring(_latin2'a',1,1)), coercibility(substring(_latin2'a',1,1));
collation(substring(_latin2'a',1,1)) coercibility(substring(_latin2'a',1,1))
latin2_general_ci 3
select collation(concat(_latin2'a',_latin2'b')), coercibility(concat(_latin2'a',_latin2'b'));
collation(concat(_latin2'a',_latin2'b')) coercibility(concat(_latin2'a',_latin2'b'))
latin2_general_ci 3
select collation(concat_ws(_latin2'a',_latin2'b')), coercibility(concat_ws(_latin2'a',_latin2'b'));
collation(concat_ws(_latin2'a',_latin2'b')) coercibility(concat_ws(_latin2'a',_latin2'b'))
latin2_general_ci 3
create table t1
select
left(_latin2'a',1),
right(_latin2'a',1),
lcase(_latin2'a'),
ucase(_latin2'a'),
substring(_latin2'a',1,1),
concat(_latin2'a',_latin2'b'),
concat_ws(_latin2'a',_latin2'b');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`left(_latin2'a',1)` char(1) character set latin2 NOT NULL default '',
`right(_latin2'a',1)` char(1) character set latin2 NOT NULL default '',
`lcase(_latin2'a')` char(1) character set latin2 NOT NULL default '',
`ucase(_latin2'a')` char(1) character set latin2 NOT NULL default '',
`substring(_latin2'a',1,1)` char(1) character set latin2 NOT NULL default '',
`concat(_latin2'a',_latin2'b')` char(2) character set latin2 NOT NULL default '',
`concat_ws(_latin2'a',_latin2'b')` char(1) character set latin2 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
mysql-test/t/func_str.test
View file @
895db718
...
@@ -132,3 +132,26 @@ CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (
...
@@ -132,3 +132,26 @@ CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (
INSERT
INTO
t1
VALUES
(
1
,
'a545f661efdd1fb66fdee3aab79945bf'
);
INSERT
INTO
t1
VALUES
(
1
,
'a545f661efdd1fb66fdee3aab79945bf'
);
SELECT
1
FROM
t1
WHERE
tmp
=
AES_DECRYPT
(
tmp
,
"password"
);
SELECT
1
FROM
t1
WHERE
tmp
=
AES_DECRYPT
(
tmp
,
"password"
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Test collation and coercibility
#
select
collation
(
lcase
(
_latin2
'a'
)),
coercibility
(
lcase
(
_latin2
'a'
));
select
collation
(
ucase
(
_latin2
'a'
)),
coercibility
(
ucase
(
_latin2
'a'
));
select
collation
(
left
(
_latin2
'a'
,
1
)),
coercibility
(
left
(
_latin2
'a'
,
1
));
select
collation
(
right
(
_latin2
'a'
,
1
)),
coercibility
(
right
(
_latin2
'a'
,
1
));
select
collation
(
substring
(
_latin2
'a'
,
1
,
1
)),
coercibility
(
substring
(
_latin2
'a'
,
1
,
1
));
select
collation
(
concat
(
_latin2
'a'
,
_latin2
'b'
)),
coercibility
(
concat
(
_latin2
'a'
,
_latin2
'b'
));
select
collation
(
concat_ws
(
_latin2
'a'
,
_latin2
'b'
)),
coercibility
(
concat_ws
(
_latin2
'a'
,
_latin2
'b'
));
create
table
t1
select
left
(
_latin2
'a'
,
1
),
right
(
_latin2
'a'
,
1
),
lcase
(
_latin2
'a'
),
ucase
(
_latin2
'a'
),
substring
(
_latin2
'a'
,
1
,
1
),
concat
(
_latin2
'a'
,
_latin2
'b'
),
concat_ws
(
_latin2
'a'
,
_latin2
'b'
);
show
create
table
t1
;
drop
table
t1
;
sql/item_strfunc.cc
View file @
895db718
...
@@ -928,7 +928,7 @@ void Item_str_func::left_right_max_length()
...
@@ -928,7 +928,7 @@ void Item_str_func::left_right_max_length()
max_length
=
args
[
0
]
->
max_length
;
max_length
=
args
[
0
]
->
max_length
;
if
(
args
[
1
]
->
const_item
())
if
(
args
[
1
]
->
const_item
())
{
{
int
length
=
(
int
)
args
[
1
]
->
val_int
()
*
default_charset_info
->
mbmaxlen
;
int
length
=
(
int
)
args
[
1
]
->
val_int
()
*
charset
()
->
mbmaxlen
;
if
(
length
<=
0
)
if
(
length
<=
0
)
max_length
=
0
;
max_length
=
0
;
else
else
...
@@ -939,6 +939,7 @@ void Item_str_func::left_right_max_length()
...
@@ -939,6 +939,7 @@ void Item_str_func::left_right_max_length()
void
Item_func_left
::
fix_length_and_dec
()
void
Item_func_left
::
fix_length_and_dec
()
{
{
set_charset
(
args
[
0
]
->
charset
(),
args
[
0
]
->
coercibility
);
left_right_max_length
();
left_right_max_length
();
}
}
...
@@ -965,6 +966,7 @@ String *Item_func_right::val_str(String *str)
...
@@ -965,6 +966,7 @@ String *Item_func_right::val_str(String *str)
void
Item_func_right
::
fix_length_and_dec
()
void
Item_func_right
::
fix_length_and_dec
()
{
{
set_charset
(
args
[
0
]
->
charset
(),
args
[
0
]
->
coercibility
);
left_right_max_length
();
left_right_max_length
();
}
}
...
...
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