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
8f254c1b
Commit
8f254c1b
authored
Aug 24, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
followup
parent
8f2d92c5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
mysql-test/r/func_set.result
mysql-test/r/func_set.result
+1
-2
sql/field.cc
sql/field.cc
+4
-6
No files found.
mysql-test/r/func_set.result
View file @
8f254c1b
...
@@ -41,8 +41,7 @@ interval(null, 1, 10, 100)
...
@@ -41,8 +41,7 @@ interval(null, 1, 10, 100)
-1
-1
drop table if exists t1,t2;
drop table if exists t1,t2;
create table t1 (id int(10) not null unique);
create table t1 (id int(10) not null unique);
create table t2 (id int(10) not null primary key,
create table t2 (id int(10) not null primary key, val int(10) not null);
val int(10) not null);
insert into t1 values (1),(2),(4);
insert into t1 values (1),(2),(4);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
insert into t2 values (1,1),(2,1),(3,1),(4,2);
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
select one.id, elt(two.val,'one','two') from t1 one, t2 two where two.id=one.id;
...
...
sql/field.cc
View file @
8f254c1b
...
@@ -4403,16 +4403,14 @@ char *Field_string::pack(char *to, const char *from, uint max_length)
...
@@ -4403,16 +4403,14 @@ char *Field_string::pack(char *to, const char *from, uint max_length)
char
*
Field_string
::
pack_key
(
char
*
to
,
const
char
*
from
,
uint
max_length
)
char
*
Field_string
::
pack_key
(
char
*
to
,
const
char
*
from
,
uint
max_length
)
{
{
const
char
*
end
=
from
+
min
(
field_length
,
max_length
);
int
length
=
min
(
field_length
,
max_length
);
int
length
;
while
(
end
>
from
&&
end
[
-
1
]
==
' '
)
end
--
;
length
=
end
-
from
;
uint
char_length
=
(
field_charset
->
mbmaxlen
>
1
)
?
uint
char_length
=
(
field_charset
->
mbmaxlen
>
1
)
?
max_length
/
field_charset
->
mbmaxlen
:
max_length
;
max_length
/
field_charset
->
mbmaxlen
:
max_length
;
if
(
length
>
char_length
)
if
(
length
>
char_length
)
char_length
=
my_charpos
(
field_charset
,
from
,
end
,
char_length
);
char_length
=
my_charpos
(
field_charset
,
from
,
from
+
length
,
char_length
);
set_if_smaller
(
length
,
char_length
);
set_if_smaller
(
length
,
char_length
);
while
(
length
&&
from
[
length
-
1
]
==
' '
)
length
--
;
*
to
=
(
uchar
)
length
;
*
to
=
(
uchar
)
length
;
memcpy
(
to
+
1
,
from
,
length
);
memcpy
(
to
+
1
,
from
,
length
);
return
to
+
1
+
length
;
return
to
+
1
+
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