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
486837b0
Commit
486837b0
authored
May 25, 2006
by
gkodinov@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/kgeorge/mysql/5.0/clean
into mysql.com:/home/kgeorge/mysql/5.0/B19700
parents
99b1d746
d6b5a890
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
0 deletions
+45
-0
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+21
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+22
-0
sql/item.h
sql/item.h
+1
-0
sql/item_subselect.cc
sql/item_subselect.cc
+1
-0
No files found.
mysql-test/r/subselect.result
View file @
486837b0
...
...
@@ -3183,3 +3183,24 @@ select * from (select min(i) from t1 where j=(select * from (select min(j) from
min(i)
1
drop table t1;
CREATE TABLE t1 (i BIGINT UNSIGNED);
INSERT INTO t1 VALUES (10000000000000000000);
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (i BIGINT UNSIGNED);
INSERT INTO t2 VALUES (10000000000000000000);
INSERT INTO t2 VALUES (1);
/* simple test */
SELECT t1.i FROM t1 JOIN t2 ON t1.i = t2.i;
i
10000000000000000000
1
/* subquery test */
SELECT t1.i FROM t1 WHERE t1.i = (SELECT MAX(i) FROM t2);
i
10000000000000000000
/* subquery test with cast*/
SELECT t1.i FROM t1 WHERE t1.i = CAST((SELECT MAX(i) FROM t2) AS UNSIGNED);
i
10000000000000000000
DROP TABLE t1;
DROP TABLE t2;
mysql-test/t/subselect.test
View file @
486837b0
...
...
@@ -2109,3 +2109,25 @@ insert into t1 values (1, 2), (2, 2), (3, 2);
select
*
from
(
select
min
(
i
)
from
t1
where
j
=
(
select
*
from
(
select
min
(
j
)
from
t1
)
t2
))
t3
;
drop
table
t1
;
#
# Bug#19700: subselect returning BIGINT always returned it as SIGNED
#
CREATE
TABLE
t1
(
i
BIGINT
UNSIGNED
);
INSERT
INTO
t1
VALUES
(
10000000000000000000
);
--
>
MAX
SIGNED
BIGINT
9323372036854775807
INSERT
INTO
t1
VALUES
(
1
);
CREATE
TABLE
t2
(
i
BIGINT
UNSIGNED
);
INSERT
INTO
t2
VALUES
(
10000000000000000000
);
--
same
as
first
table
INSERT
INTO
t2
VALUES
(
1
);
/* simple test */
SELECT
t1
.
i
FROM
t1
JOIN
t2
ON
t1
.
i
=
t2
.
i
;
/* subquery test */
SELECT
t1
.
i
FROM
t1
WHERE
t1
.
i
=
(
SELECT
MAX
(
i
)
FROM
t2
);
/* subquery test with cast*/
SELECT
t1
.
i
FROM
t1
WHERE
t1
.
i
=
CAST
((
SELECT
MAX
(
i
)
FROM
t2
)
AS
UNSIGNED
);
DROP
TABLE
t1
;
DROP
TABLE
t2
;
sql/item.h
View file @
486837b0
...
...
@@ -2245,6 +2245,7 @@ class Item_cache: public Item
max_length
=
item
->
max_length
;
decimals
=
item
->
decimals
;
collation
.
set
(
item
->
collation
);
unsigned_flag
=
item
->
unsigned_flag
;
return
0
;
};
virtual
void
store
(
Item
*
)
=
0
;
...
...
sql/item_subselect.cc
View file @
486837b0
...
...
@@ -404,6 +404,7 @@ void Item_singlerow_subselect::fix_length_and_dec()
engine
->
fix_length_and_dec
(
row
);
value
=
*
row
;
}
unsigned_flag
=
value
->
unsigned_flag
;
/*
If there are not tables in subquery then ability to have NULL value
depends on SELECT list (if single row subquery have tables then it
...
...
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