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
5df7611c
Commit
5df7611c
authored
Sep 12, 2006
by
kaa@polly.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post-review fixes for bug #20924
parent
268c7a35
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
18 deletions
+31
-18
mysql-test/r/case.result
mysql-test/r/case.result
+1
-0
mysql-test/r/func_if.result
mysql-test/r/func_if.result
+1
-0
mysql-test/r/func_test.result
mysql-test/r/func_test.result
+1
-0
mysql-test/r/user_var.result
mysql-test/r/user_var.result
+1
-0
mysql-test/t/case.test
mysql-test/t/case.test
+4
-2
mysql-test/t/func_if.test
mysql-test/t/func_if.test
+7
-3
mysql-test/t/func_test.test
mysql-test/t/func_test.test
+4
-2
mysql-test/t/user_var.test
mysql-test/t/user_var.test
+4
-2
sql/item_func.cc
sql/item_func.cc
+6
-7
sql/item_func.h
sql/item_func.h
+1
-1
sql/log_event.cc
sql/log_event.cc
+1
-1
No files found.
mysql-test/r/case.result
View file @
5df7611c
...
...
@@ -183,3 +183,4 @@ CASE 1 WHEN 1 THEN 18446744073709551615 ELSE 1 END
SELECT COALESCE(18446744073709551615);
COALESCE(18446744073709551615)
18446744073709551615
End of 4.1 tests
mysql-test/r/func_if.result
View file @
5df7611c
...
...
@@ -105,3 +105,4 @@ IF(1 != 0, 18446744073709551615, 1)
SELECT IFNULL(NULL, 18446744073709551615);
IFNULL(NULL, 18446744073709551615)
18446744073709551615
End of 4.1 tests
mysql-test/r/func_test.result
View file @
5df7611c
...
...
@@ -189,3 +189,4 @@ GREATEST(1, 18446744073709551615)
SELECT LEAST(1, 18446744073709551615);
LEAST(1, 18446744073709551615)
1
End of 4.1 tests
mysql-test/r/user_var.result
View file @
5df7611c
...
...
@@ -207,3 +207,4 @@ set @a=18446744073709551615;
select @a;
@a
18446744073709551615
End of 4.1 tests
mysql-test/t/case.test
View file @
5df7611c
...
...
@@ -131,9 +131,11 @@ from t1 where b=3 group by b;
drop
table
t1
;
#
# Bug #20924: UNSIGNED values in CASE and COALESCE are treated as SIGNED
# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
# functions
# - UNSIGNED values in CASE and COALESCE are treated as SIGNED
#
SELECT
CASE
1
WHEN
1
THEN
18446744073709551615
ELSE
1
END
;
SELECT
COALESCE
(
18446744073709551615
);
#
End of 4.1 tests
--
echo
End
of
4.1
tests
mysql-test/t/func_if.test
View file @
5df7611c
...
...
@@ -74,13 +74,17 @@ SELECT a, NULLIF(a,'') FROM t1 WHERE NULLIF(a,'') IS NULL;
DROP
TABLE
t1
;
#
# Bug #20924: UNSIGNED values in IF() are treated as SIGNED
# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
# functions
# - UNSIGNED values in IF() are treated as SIGNED
#
SELECT
IF
(
1
!=
0
,
18446744073709551615
,
1
);
#
# Bug #20924: UNSIGNED values in IFNULL() are treated as SIGNED
# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
# functions
# - UNSIGNED values in IFNULL() are treated as SIGNED
#
SELECT
IFNULL
(
NULL
,
18446744073709551615
);
#
End of 4.1 tests
--
echo
End
of
4.1
tests
mysql-test/t/func_test.test
View file @
5df7611c
...
...
@@ -109,9 +109,11 @@ select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3;
select
5
mod
3
,
5
mod
-
3
,
-
5
mod
3
,
-
5
mod
-
3
;
#
# Bug #20924: UNSIGNED values in GREATEST() and LEAST() are treated as SIGNED
# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
# functions
# - UNSIGNED values in GREATEST() and LEAST() are treated as SIGNED
#
SELECT
GREATEST
(
1
,
18446744073709551615
);
SELECT
LEAST
(
1
,
18446744073709551615
);
#
End of 4.1 tests
--
echo
End
of
4.1
tests
mysql-test/t/user_var.test
View file @
5df7611c
...
...
@@ -142,9 +142,11 @@ select @@global.version;
select
@@
session
.
VERSION
;
#
# Bug #20924 SET on a user variable saves UNSIGNED as SIGNED
# Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various
# functions
# - SET on a user variable saves UNSIGNED as SIGNED
#
set
@
a
=
18446744073709551615
;
select
@
a
;
#
End of 4.1 tests
--
echo
End
of
4.1
tests
sql/item_func.cc
View file @
5df7611c
...
...
@@ -1252,8 +1252,7 @@ longlong Item_func_min_max::val_int()
{
if
(
args
[
i
]
->
null_value
)
continue
;
if
(
unsigned_flag
&&
arg_unsigned_flag
||
(
!
unsigned_flag
&&
!
arg_unsigned_flag
))
if
(
unsigned_flag
==
arg_unsigned_flag
)
cmp
=
tmp
<
value
;
else
if
(
unsigned_flag
)
cmp
=
compare_int_signed_unsigned
(
tmp
,
value
)
<
0
;
...
...
@@ -2614,26 +2613,26 @@ Item_func_set_user_var::update()
case
REAL_RESULT
:
{
res
=
update_hash
((
void
*
)
&
save_result
.
vreal
,
sizeof
(
save_result
.
vreal
),
REAL_RESULT
,
&
my_charset_bin
,
DERIVATION_IMPLICIT
);
REAL_RESULT
,
&
my_charset_bin
,
DERIVATION_IMPLICIT
,
0
);
break
;
}
case
INT_RESULT
:
{
res
=
update_hash
((
void
*
)
&
save_result
.
vint
,
sizeof
(
save_result
.
vint
),
INT_RESULT
,
&
my_charset_bin
,
DERIVATION_IMPLICIT
,
unsigned_flag
);
INT_RESULT
,
&
my_charset_bin
,
DERIVATION_IMPLICIT
,
unsigned_flag
);
break
;
}
case
STRING_RESULT
:
{
if
(
!
save_result
.
vstr
)
// Null value
res
=
update_hash
((
void
*
)
0
,
0
,
STRING_RESULT
,
&
my_charset_bin
,
DERIVATION_IMPLICIT
);
DERIVATION_IMPLICIT
,
0
);
else
res
=
update_hash
((
void
*
)
save_result
.
vstr
->
ptr
(),
save_result
.
vstr
->
length
(),
STRING_RESULT
,
save_result
.
vstr
->
charset
(),
DERIVATION_IMPLICIT
);
DERIVATION_IMPLICIT
,
0
);
break
;
}
case
ROW_RESULT
:
...
...
sql/item_func.h
View file @
5df7611c
...
...
@@ -962,7 +962,7 @@ class Item_func_set_user_var :public Item_func
longlong
val_int
();
String
*
val_str
(
String
*
str
);
bool
update_hash
(
void
*
ptr
,
uint
length
,
enum
Item_result
type
,
CHARSET_INFO
*
cs
,
Derivation
dv
,
bool
unsigned_arg
=
0
);
CHARSET_INFO
*
cs
,
Derivation
dv
,
bool
unsigned_arg
);
bool
check
();
bool
update
();
enum
Item_result
result_type
()
const
{
return
cached_result_type
;
}
...
...
sql/log_event.cc
View file @
5df7611c
...
...
@@ -2607,7 +2607,7 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli)
a single record and with a single column. Thus, like
a column value, it could always have IMPLICIT derivation.
*/
e
.
update_hash
(
val
,
val_len
,
type
,
charset
,
DERIVATION_IMPLICIT
);
e
.
update_hash
(
val
,
val_len
,
type
,
charset
,
DERIVATION_IMPLICIT
,
0
);
free_root
(
thd
->
mem_root
,
0
);
rli
->
inc_event_relay_log_pos
(
get_event_len
());
...
...
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