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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7b93f385
Commit
7b93f385
authored
Jun 10, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function INSERT() now works according to coercibility rules
Test for INSERT() has been added
parent
54c04738
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+7
-2
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+3
-1
sql/item_strfunc.cc
sql/item_strfunc.cc
+8
-0
No files found.
mysql-test/r/func_str.result
View file @
7b93f385
...
...
@@ -303,6 +303,9 @@ latin2_general_ci 3
select collation(substring(_latin2'ab',1)), coercibility(substring(_latin2'ab',1));
collation(substring(_latin2'ab',1)) coercibility(substring(_latin2'ab',1))
latin2_general_ci 3
select collation(insert(_latin2'abcd',2,3,_latin2'ef')), coercibility(insert(_latin2'abcd',2,3,_latin2'ef'));
collation(insert(_latin2'abcd',2,3,_latin2'ef')) coercibility(insert(_latin2'abcd',2,3,_latin2'ef'))
latin2_general_ci 3
create table t1
select
left(_latin2'a',1),
...
...
@@ -322,7 +325,8 @@ repeat(_latin2'a',10),
reverse(_latin2'ab'),
quote(_latin2'ab'),
soundex(_latin2'ab'),
substring(_latin2'ab',1)
substring(_latin2'ab',1),
insert(_latin2'abcd',2,3,_latin2'ef')
;
show create table t1;
Table Create Table
...
...
@@ -344,6 +348,7 @@ t1 CREATE TABLE `t1` (
`reverse(_latin2'ab')` char(2) character set latin2 NOT NULL default '',
`quote(_latin2'ab')` char(6) character set latin2 NOT NULL default '',
`soundex(_latin2'ab')` char(4) character set latin2 NOT NULL default '',
`substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default ''
`substring(_latin2'ab',1)` char(2) character set latin2 NOT NULL default '',
`insert(_latin2'abcd',2,3,_latin2'ef')` char(6) character set latin2 NOT NULL default ''
) TYPE=MyISAM CHARSET=latin1
drop table t1;
mysql-test/t/func_str.test
View file @
7b93f385
...
...
@@ -154,6 +154,7 @@ select collation(reverse(_latin2'ab')), coercibility(reverse(_latin2'ab'));
select
collation
(
quote
(
_latin2
'ab'
)),
coercibility
(
quote
(
_latin2
'ab'
));
select
collation
(
soundex
(
_latin2
'ab'
)),
coercibility
(
soundex
(
_latin2
'ab'
));
select
collation
(
substring
(
_latin2
'ab'
,
1
)),
coercibility
(
substring
(
_latin2
'ab'
,
1
));
select
collation
(
insert
(
_latin2
'abcd'
,
2
,
3
,
_latin2
'ef'
)),
coercibility
(
insert
(
_latin2
'abcd'
,
2
,
3
,
_latin2
'ef'
));
create
table
t1
select
...
...
@@ -174,7 +175,8 @@ select
reverse
(
_latin2
'ab'
),
quote
(
_latin2
'ab'
),
soundex
(
_latin2
'ab'
),
substring
(
_latin2
'ab'
,
1
)
substring
(
_latin2
'ab'
,
1
),
insert
(
_latin2
'abcd'
,
2
,
3
,
_latin2
'ef'
)
;
show
create
table
t1
;
...
...
sql/item_strfunc.cc
View file @
7b93f385
...
...
@@ -861,6 +861,14 @@ String *Item_func_insert::val_str(String *str)
void
Item_func_insert
::
fix_length_and_dec
()
{
if
(
set_charset
(
args
[
0
]
->
charset
(),
args
[
0
]
->
coercibility
,
args
[
3
]
->
charset
(),
args
[
3
]
->
coercibility
))
{
my_error
(
ER_CANT_AGGREGATE_COLLATIONS
,
MYF
(
0
),
args
[
0
]
->
charset
()
->
name
,
coercion_name
(
args
[
0
]
->
coercibility
),
args
[
3
]
->
charset
()
->
name
,
coercion_name
(
args
[
3
]
->
coercibility
),
func_name
());
}
max_length
=
args
[
0
]
->
max_length
+
args
[
3
]
->
max_length
;
if
(
max_length
>
MAX_BLOB_WIDTH
)
{
...
...
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