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
abf659de
Commit
abf659de
authored
Mar 10, 2005
by
timour@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/timka/mysql/src/4.1-bug-7425
into mysql.com:/home/timka/mysql/src/4.1-dbg
parents
0b0a9188
f489e562
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
mysql-test/r/select.result
mysql-test/r/select.result
+23
-0
mysql-test/t/select.test
mysql-test/t/select.test
+11
-0
sql/filesort.cc
sql/filesort.cc
+8
-2
sql/item.cc
sql/item.cc
+1
-0
No files found.
mysql-test/r/select.result
View file @
abf659de
...
...
@@ -2422,3 +2422,26 @@ SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
city
London
DROP TABLE t1;
create table t1 (a int(11) unsigned, b int(11) unsigned);
insert into t1 values (1,0), (1,1), (1,2);
select a-b from t1 order by 1;
a-b
0
1
18446744073709551615
select a-b , (a-b < 0) from t1 order by 1;
a-b (a-b < 0)
0 0
1 0
18446744073709551615 0
select a-b as d, (a-b >= 0), b from t1 group by b having d >= 0;
d (a-b >= 0) b
1 1 0
0 1 1
18446744073709551615 1 2
select cast((a - b) as unsigned) from t1 order by 1;
cast((a - b) as unsigned)
0
1
18446744073709551615
drop table t1;
mysql-test/t/select.test
View file @
abf659de
...
...
@@ -1964,3 +1964,14 @@ SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London';
DROP
TABLE
t1
;
#
# Bug#7425 inconsistent sort order on unsigned columns result of substraction
#
create
table
t1
(
a
int
(
11
)
unsigned
,
b
int
(
11
)
unsigned
);
insert
into
t1
values
(
1
,
0
),
(
1
,
1
),
(
1
,
2
);
select
a
-
b
from
t1
order
by
1
;
select
a
-
b
,
(
a
-
b
<
0
)
from
t1
order
by
1
;
select
a
-
b
as
d
,
(
a
-
b
>=
0
),
b
from
t1
group
by
b
having
d
>=
0
;
select
cast
((
a
-
b
)
as
unsigned
)
from
t1
order
by
1
;
drop
table
t1
;
sql/filesort.cc
View file @
abf659de
...
...
@@ -656,12 +656,18 @@ static void make_sortkey(register SORTPARAM *param,
to
[
3
]
=
(
uchar
)
(
value
>>
32
);
to
[
2
]
=
(
uchar
)
(
value
>>
40
);
to
[
1
]
=
(
uchar
)
(
value
>>
48
);
to
[
0
]
=
(
uchar
)
(
value
>>
56
)
^
128
;
// Fix sign
if
(
item
->
unsigned_flag
)
/* Fix sign */
to
[
0
]
=
(
uchar
)
(
value
>>
56
);
else
to
[
0
]
=
(
uchar
)
(
value
>>
56
)
^
128
;
/* Reverse signbit */
#else
to
[
3
]
=
(
uchar
)
value
;
to
[
2
]
=
(
uchar
)
(
value
>>
8
);
to
[
1
]
=
(
uchar
)
(
value
>>
16
);
to
[
0
]
=
(
uchar
)
(
value
>>
24
)
^
128
;
// Fix sign
if
(
item
->
unsigned_flag
)
/* Fix sign */
to
[
0
]
=
(
uchar
)
(
value
>>
24
);
else
to
[
0
]
=
(
uchar
)
(
value
>>
24
)
^
128
;
/* Reverse signbit */
#endif
break
;
}
...
...
sql/item.cc
View file @
abf659de
...
...
@@ -2281,6 +2281,7 @@ void Item_ref::set_properties()
decimals
=
(
*
ref
)
->
decimals
;
collation
.
set
((
*
ref
)
->
collation
);
with_sum_func
=
(
*
ref
)
->
with_sum_func
;
unsigned_flag
=
(
*
ref
)
->
unsigned_flag
;
fixed
=
1
;
}
...
...
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