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
59400e21
Commit
59400e21
authored
Feb 04, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in ulonglong parsing for constructs that only takes unsigned longlong as parameter.
parent
3d067e7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
mysql-test/r/bigint.result
mysql-test/r/bigint.result
+12
-0
mysql-test/t/bigint.test
mysql-test/t/bigint.test
+11
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+4
-3
No files found.
mysql-test/r/bigint.result
View file @
59400e21
...
@@ -7,6 +7,9 @@ select 9223372036854775807,-009223372036854775808;
...
@@ -7,6 +7,9 @@ select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999;
select +9999999999999999999,-9999999999999999999;
+9999999999999999999 -9999999999999999999
+9999999999999999999 -9999999999999999999
10000000000000000000 -10000000000000000000
10000000000000000000 -10000000000000000000
select 9223372036854775808+1;
9223372036854775808+1
9223372036854775808
drop table if exists t1;
drop table if exists t1;
create table t1 (a bigint unsigned not null, primary key(a));
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
...
@@ -52,3 +55,12 @@ select min(big),max(big),max(big)-1 from t1 group by a;
...
@@ -52,3 +55,12 @@ select min(big),max(big),max(big)-1 from t1 group by a;
min(big) max(big) max(big)-1
min(big) max(big) max(big)-1
-1 9223372036854775807 9223372036854775806
-1 9223372036854775807 9223372036854775806
drop table t1;
drop table t1;
create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999;
insert into t1 values (null,1);
select * from t1;
id a
9999999999 1
select * from t1 limit 9999999999;
id a
9999999999 1
drop table t1;
mysql-test/t/bigint.test
View file @
59400e21
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
select
0
,
256
,
00000000000000065536
,
2147483647
,
-
2147483648
,
2147483648
,
+
4294967296
;
select
0
,
256
,
00000000000000065536
,
2147483647
,
-
2147483648
,
2147483648
,
+
4294967296
;
select
9223372036854775807
,
-
00
9223372036854775808
;
select
9223372036854775807
,
-
00
9223372036854775808
;
select
+
9999999999999999999
,
-
9999999999999999999
;
select
+
9999999999999999999
,
-
9999999999999999999
;
select
9223372036854775808
+
1
;
#
#
# In 3.23 we have to disable the test of column to bigint as
# In 3.23 we have to disable the test of column to bigint as
# this fails on AIX powerpc (the resolution for double is not good enough)
# this fails on AIX powerpc (the resolution for double is not good enough)
...
@@ -35,3 +35,13 @@ alter table t1 modify big bigint not null;
...
@@ -35,3 +35,13 @@ alter table t1 modify big bigint not null;
select
min
(
big
),
max
(
big
),
max
(
big
)
-
1
from
t1
;
select
min
(
big
),
max
(
big
),
max
(
big
)
-
1
from
t1
;
select
min
(
big
),
max
(
big
),
max
(
big
)
-
1
from
t1
group
by
a
;
select
min
(
big
),
max
(
big
),
max
(
big
)
-
1
from
t1
group
by
a
;
drop
table
t1
;
drop
table
t1
;
#
# Test problem with big values fir auto_increment
#
create
table
t1
(
id
bigint
auto_increment
primary
key
,
a
int
)
auto_increment
=
9999999999
;
insert
into
t1
values
(
null
,
1
);
select
*
from
t1
;
select
*
from
t1
limit
9999999999
;
drop
table
t1
;
sql/sql_yacc.yy
View file @
59400e21
...
@@ -2376,6 +2376,7 @@ delete_limit_clause:
...
@@ -2376,6 +2376,7 @@ delete_limit_clause:
ULONG_NUM:
ULONG_NUM:
NUM { $$= strtoul($1.str,NULL,10); }
NUM { $$= strtoul($1.str,NULL,10); }
| LONG_NUM { $$= (ulonglong) strtoll($1.str,NULL,10); }
| ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); }
| ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); }
| REAL_NUM { $$= strtoul($1.str,NULL,10); }
| REAL_NUM { $$= strtoul($1.str,NULL,10); }
| FLOAT_NUM { $$= strtoul($1.str,NULL,10); };
| FLOAT_NUM { $$= strtoul($1.str,NULL,10); };
...
@@ -2383,7 +2384,7 @@ ULONG_NUM:
...
@@ -2383,7 +2384,7 @@ ULONG_NUM:
ulonglong_num:
ulonglong_num:
NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
| ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); }
| ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); }
| LONG_NUM { $$= (ulonglong) strto
u
l($1.str,NULL,10); }
| LONG_NUM { $$= (ulonglong) strto
l
l($1.str,NULL,10); }
| REAL_NUM { $$= strtoull($1.str,NULL,10); }
| REAL_NUM { $$= strtoull($1.str,NULL,10); }
| FLOAT_NUM { $$= strtoull($1.str,NULL,10); };
| FLOAT_NUM { $$= strtoull($1.str,NULL,10); };
...
@@ -3110,8 +3111,8 @@ text_string:
...
@@ -3110,8 +3111,8 @@ text_string:
literal:
literal:
text_literal { $$ = $1; }
text_literal { $$ = $1; }
| NUM { $$ = new Item_int($1.str, (longlong)
atol($1.str
),$1.length); }
| NUM { $$ = new Item_int($1.str, (longlong)
strtol($1.str, NULL, 10
),$1.length); }
| LONG_NUM { $$ = new Item_int($1.str); }
| LONG_NUM { $$ = new Item_int($1.str
, (longlong) strtoll($1.str,NULL,10), $1.length
); }
| ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
| ULONGLONG_NUM { $$ = new Item_uint($1.str, $1.length); }
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
| REAL_NUM { $$ = new Item_real($1.str, $1.length); }
| FLOAT_NUM { $$ = new Item_float($1.str, $1.length); }
| FLOAT_NUM { $$ = new Item_float($1.str, $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