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
0da39cac
Commit
0da39cac
authored
Sep 12, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix BIGINT+MEDIUMINT type aggregation
parent
347eeefb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
mysql-test/r/type_uint.result
mysql-test/r/type_uint.result
+19
-0
mysql-test/t/type_uint.test
mysql-test/t/type_uint.test
+8
-0
sql/field.cc
sql/field.cc
+1
-1
No files found.
mysql-test/r/type_uint.result
View file @
0da39cac
...
...
@@ -14,3 +14,22 @@ this
0
4294967295
drop table t1;
create table t1 (a bigint unsigned, b mediumint unsigned);
insert t1 values (1,2),(0xffffffffffffffff,0xffffff);
select coalesce(a,b), coalesce(b,a) from t1;
coalesce(a,b) coalesce(b,a)
1 2
18446744073709551615 16777215
create table t2 as select a from t1 union select b from t1;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t2;
a
1
18446744073709551615
2
16777215
drop table t1, t2;
mysql-test/t/type_uint.test
View file @
0da39cac
...
...
@@ -15,3 +15,11 @@ select * from t1;
drop
table
t1
;
# End of 4.1 tests
create
table
t1
(
a
bigint
unsigned
,
b
mediumint
unsigned
);
insert
t1
values
(
1
,
2
),(
0xffffffffffffffff
,
0xffffff
);
select
coalesce
(
a
,
b
),
coalesce
(
b
,
a
)
from
t1
;
create
table
t2
as
select
a
from
t1
union
select
b
from
t1
;
show
create
table
t2
;
select
*
from
t2
;
drop
table
t1
,
t2
;
sql/field.cc
View file @
0da39cac
...
...
@@ -359,7 +359,7 @@ static enum_field_types field_types_merge_rules [FIELDTYPE_NUM][FIELDTYPE_NUM]=
//MYSQL_TYPE_NULL MYSQL_TYPE_TIMESTAMP
MYSQL_TYPE_LONGLONG
,
MYSQL_TYPE_VARCHAR
,
//MYSQL_TYPE_LONGLONG MYSQL_TYPE_INT24
MYSQL_TYPE_LONGLONG
,
MYSQL_TYPE_LONG
,
MYSQL_TYPE_LONGLONG
,
MYSQL_TYPE_LONG
LONG
,
//MYSQL_TYPE_DATE MYSQL_TYPE_TIME
MYSQL_TYPE_VARCHAR
,
MYSQL_TYPE_VARCHAR
,
//MYSQL_TYPE_DATETIME MYSQL_TYPE_YEAR
...
...
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