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
b518e93b
Commit
b518e93b
authored
Aug 11, 2003
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed collation of Item_cache family (BUG#951)
parent
786af341
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+7
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+11
-0
sql/item.cc
sql/item.cc
+1
-1
sql/item.h
sql/item.h
+2
-0
No files found.
mysql-test/r/subselect.result
View file @
b518e93b
...
@@ -1251,3 +1251,10 @@ a
...
@@ -1251,3 +1251,10 @@ a
2
2
10
10
drop table t1,t2;
drop table t1,t2;
CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
INSERT INTO t1 VALUES ('z','?');
select * from t1 where s1 > (select max(s2) from t1);
ERROR HY000: Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation '>'
select * from t1 where s1 > any (select max(s2) from t1);
drop table t1;
mysql-test/t/subselect.test
View file @
b518e93b
...
@@ -853,3 +853,14 @@ insert into t3 values (1),(2),(10),(50);
...
@@ -853,3 +853,14 @@ insert into t3 values (1),(2),(10),(50);
select
a
from
t3
where
t3
.
a
in
(
select
a
from
t1
where
a
<=
3
union
select
*
from
t2
where
a
<=
30
);
select
a
from
t3
where
t3
.
a
in
(
select
a
from
t1
where
a
<=
3
union
select
*
from
t2
where
a
<=
30
);
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# collation test
#
CREATE
TABLE
t1
(
s1
CHAR
(
5
)
COLLATE
latin1_german1_ci
,
s2
CHAR
(
5
)
COLLATE
latin1_swedish_ci
);
INSERT
INTO
t1
VALUES
(
'z'
,
'?'
);
--
error
1265
select
*
from
t1
where
s1
>
(
select
max
(
s2
)
from
t1
);
--
error
1265
select
*
from
t1
where
s1
>
any
(
select
max
(
s2
)
from
t1
);
drop
table
t1
;
sql/item.cc
View file @
b518e93b
...
@@ -1704,7 +1704,7 @@ void Item_cache_str::store(Item *item)
...
@@ -1704,7 +1704,7 @@ void Item_cache_str::store(Item *item)
str_value
.
copy
(
*
value
);
str_value
.
copy
(
*
value
);
value
=
&
str_value
;
value
=
&
str_value
;
}
}
collation
.
set
(
item
->
collation
);
}
}
double
Item_cache_str
::
val
()
double
Item_cache_str
::
val
()
{
{
...
...
sql/item.h
View file @
b518e93b
...
@@ -852,6 +852,7 @@ class Item_cache_int: public Item_cache
...
@@ -852,6 +852,7 @@ class Item_cache_int: public Item_cache
{
{
value
=
item
->
val_int_result
();
value
=
item
->
val_int_result
();
null_value
=
item
->
null_value
;
null_value
=
item
->
null_value
;
collation
.
set
(
item
->
collation
);
}
}
double
val
()
{
return
(
double
)
value
;
}
double
val
()
{
return
(
double
)
value
;
}
longlong
val_int
()
{
return
value
;
}
longlong
val_int
()
{
return
value
;
}
...
@@ -869,6 +870,7 @@ class Item_cache_real: public Item_cache
...
@@ -869,6 +870,7 @@ class Item_cache_real: public Item_cache
{
{
value
=
item
->
val_result
();
value
=
item
->
val_result
();
null_value
=
item
->
null_value
;
null_value
=
item
->
null_value
;
collation
.
set
(
item
->
collation
);
}
}
double
val
()
{
return
value
;
}
double
val
()
{
return
value
;
}
longlong
val_int
()
{
return
(
longlong
)
(
value
+
(
value
>
0
?
0.5
:
-
0.5
));
}
longlong
val_int
()
{
return
(
longlong
)
(
value
+
(
value
>
0
?
0.5
:
-
0.5
));
}
...
...
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