Skip to content

Commit af7d396

Browse files
author
kent@kent-amd64.(none)
committed
Merge mysql.com:/home/kent/bk/bug30069/mysql-4.1-build
into mysql.com:/home/kent/bk/bug30069/mysql-5.0-build
2 parents 339b321 + 3bb7cac commit af7d396

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

mysql-test/r/bigint.result

+6
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ t2.value64=t1.value64;
170170
value64 value32 value64 value32
171171
9223372036854775807 2 9223372036854775807 4
172172
drop table t1, t2;
173+
create table t1 (sint64 bigint not null);
174+
insert into t1 values (-9223372036854775808);
175+
select * from t1;
176+
sint64
177+
-9223372036854775808
178+
drop table t1;
173179
create table t1 select 1 as 'a';
174180
show create table t1;
175181
Table Create Table

mysql-test/t/bigint.test

+9
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ t2.value64=t1.value64;
113113

114114
drop table t1, t2;
115115

116+
# Test for BUG#30069, can't handle bigint -9223372036854775808 on
117+
# x86_64, with some GCC versions and optimizations.
118+
119+
create table t1 (sint64 bigint not null);
120+
insert into t1 values (-9223372036854775808);
121+
select * from t1;
122+
123+
drop table t1;
124+
116125
# End of 4.1 tests
117126

118127
#

strings/ctype-simple.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ int my_long10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
845845
{
846846
if (val < 0)
847847
{
848-
val= -val;
848+
val= -(unsigned long int)val;
849849
*dst++= '-';
850850
len--;
851851
sign= 1;
@@ -881,7 +881,7 @@ int my_longlong10_to_str_8bit(CHARSET_INFO *cs __attribute__((unused)),
881881
{
882882
if (val < 0)
883883
{
884-
val = -val;
884+
val = -(ulonglong)val;
885885
*dst++= '-';
886886
len--;
887887
sign= 1;

0 commit comments

Comments
 (0)