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
0997684f
Commit
0997684f
authored
Mar 16, 2005
by
lars@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge lthalmann@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/bkroot/mysql-4.1
parents
65d88538
a7b877df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
14 deletions
+26
-14
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+10
-1
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+9
-0
sql/item_func.cc
sql/item_func.cc
+0
-5
sql/item_strfunc.cc
sql/item_strfunc.cc
+7
-8
No files found.
mysql-test/r/func_str.result
View file @
0997684f
...
@@ -512,7 +512,7 @@ collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')) coercibility(make_set(
...
@@ -512,7 +512,7 @@ collation(make_set(255,_latin2'a',_latin2'b',_latin2'c')) coercibility(make_set(
latin2_general_ci 4
latin2_general_ci 4
select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '));
select collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')), coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '));
collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')) coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '))
collation(export_set(255,_latin2'y',_latin2'n',_latin2' ')) coercibility(export_set(255,_latin2'y',_latin2'n',_latin2' '))
binary
4
latin2_general_ci
4
select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a '));
select collation(trim(_latin2' a ')), coercibility(trim(_latin2' a '));
collation(trim(_latin2' a ')) coercibility(trim(_latin2' a '))
collation(trim(_latin2' a ')) coercibility(trim(_latin2' a '))
latin2_general_ci 4
latin2_general_ci 4
...
@@ -627,6 +627,15 @@ t1 CREATE TABLE `t1` (
...
@@ -627,6 +627,15 @@ t1 CREATE TABLE `t1` (
`encode('abcd','ab')` binary(4) NOT NULL default ''
`encode('abcd','ab')` binary(4) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t1;
create table t1 (a char character set latin2);
insert into t1 values (null);
select charset(a), collation(a), coercibility(a) from t1;
charset(a) collation(a) coercibility(a)
latin2 latin2_general_ci 2
drop table t1;
select charset(null), collation(null), coercibility(null);
charset(null) collation(null) coercibility(null)
binary binary 5
select SUBSTR('abcdefg',3,2);
select SUBSTR('abcdefg',3,2);
SUBSTR('abcdefg',3,2)
SUBSTR('abcdefg',3,2)
cd
cd
...
...
mysql-test/t/func_str.test
View file @
0997684f
...
@@ -368,6 +368,15 @@ select
...
@@ -368,6 +368,15 @@ select
show
create
table
t1
;
show
create
table
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug#9129
#
create
table
t1
(
a
char
character
set
latin2
);
insert
into
t1
values
(
null
);
select
charset
(
a
),
collation
(
a
),
coercibility
(
a
)
from
t1
;
drop
table
t1
;
select
charset
(
null
),
collation
(
null
),
coercibility
(
null
);
#
#
# test for SUBSTR
# test for SUBSTR
#
#
...
...
sql/item_func.cc
View file @
0997684f
...
@@ -1346,11 +1346,6 @@ longlong Item_func_char_length::val_int()
...
@@ -1346,11 +1346,6 @@ longlong Item_func_char_length::val_int()
longlong
Item_func_coercibility
::
val_int
()
longlong
Item_func_coercibility
::
val_int
()
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
if
(
args
[
0
]
->
null_value
)
{
null_value
=
1
;
return
0
;
}
null_value
=
0
;
null_value
=
0
;
return
(
longlong
)
args
[
0
]
->
collation
.
derivation
;
return
(
longlong
)
args
[
0
]
->
collation
.
derivation
;
}
}
...
...
sql/item_strfunc.cc
View file @
0997684f
...
@@ -2290,12 +2290,11 @@ bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const
...
@@ -2290,12 +2290,11 @@ bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const
String
*
Item_func_charset
::
val_str
(
String
*
str
)
String
*
Item_func_charset
::
val_str
(
String
*
str
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
String
*
res
=
args
[
0
]
->
val_str
(
str
);
uint
dummy_errors
;
uint
dummy_errors
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
!
res
->
charset
())))
CHARSET_INFO
*
cs
=
args
[
0
]
->
collation
.
collation
;
return
0
;
null_value
=
0
;
str
->
copy
(
res
->
charset
()
->
csname
,
strlen
(
res
->
charset
()
->
csname
),
str
->
copy
(
cs
->
csname
,
strlen
(
cs
->
csname
),
&
my_charset_latin1
,
collation
.
collation
,
&
dummy_errors
);
&
my_charset_latin1
,
collation
.
collation
,
&
dummy_errors
);
return
str
;
return
str
;
}
}
...
@@ -2303,12 +2302,11 @@ String *Item_func_charset::val_str(String *str)
...
@@ -2303,12 +2302,11 @@ String *Item_func_charset::val_str(String *str)
String
*
Item_func_collation
::
val_str
(
String
*
str
)
String
*
Item_func_collation
::
val_str
(
String
*
str
)
{
{
DBUG_ASSERT
(
fixed
==
1
);
DBUG_ASSERT
(
fixed
==
1
);
String
*
res
=
args
[
0
]
->
val_str
(
str
);
uint
dummy_errors
;
uint
dummy_errors
;
CHARSET_INFO
*
cs
=
args
[
0
]
->
collation
.
collation
;
if
((
null_value
=
(
args
[
0
]
->
null_value
||
!
res
->
charset
())))
null_value
=
0
;
return
0
;
str
->
copy
(
cs
->
name
,
strlen
(
cs
->
name
),
str
->
copy
(
res
->
charset
()
->
name
,
strlen
(
res
->
charset
()
->
name
),
&
my_charset_latin1
,
collation
.
collation
,
&
dummy_errors
);
&
my_charset_latin1
,
collation
.
collation
,
&
dummy_errors
);
return
str
;
return
str
;
}
}
...
@@ -2472,6 +2470,7 @@ String* Item_func_export_set::val_str(String* str)
...
@@ -2472,6 +2470,7 @@ String* Item_func_export_set::val_str(String* str)
uint
num_set_values
=
64
;
uint
num_set_values
=
64
;
ulonglong
mask
=
0x1
;
ulonglong
mask
=
0x1
;
str
->
length
(
0
);
str
->
length
(
0
);
str
->
set_charset
(
collation
.
collation
);
/* Check if some argument is a NULL value */
/* Check if some argument is a NULL value */
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
args
[
2
]
->
null_value
)
if
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
||
args
[
2
]
->
null_value
)
...
...
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