mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
This commit is contained in:
commit
7d384e4633
3 changed files with 43 additions and 2 deletions
|
@ -2579,3 +2579,24 @@ COUNT(*)
|
||||||
2
|
2
|
||||||
DROP VIEW v2;
|
DROP VIEW v2;
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY,
|
||||||
|
td date DEFAULT NULL, KEY idx(td));
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1, '2005-01-01'), (2, '2005-01-02'), (3, '2005-01-02'),
|
||||||
|
(4, '2005-01-03'), (5, '2005-01-04'), (6, '2005-01-05'),
|
||||||
|
(7, '2005-01-05'), (8, '2005-01-05'), (9, '2005-01-06');
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
SELECT * FROM t1 WHERE td BETWEEN '2005.01.02' AND '2005.01.04';
|
||||||
|
id td
|
||||||
|
2 2005-01-02
|
||||||
|
3 2005-01-02
|
||||||
|
4 2005-01-03
|
||||||
|
5 2005-01-04
|
||||||
|
SELECT * FROM v1 WHERE td BETWEEN '2005.01.02' AND '2005.01.04';
|
||||||
|
id td
|
||||||
|
2 2005-01-02
|
||||||
|
3 2005-01-02
|
||||||
|
4 2005-01-03
|
||||||
|
5 2005-01-04
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
|
@ -2434,3 +2434,23 @@ SELECT COUNT(*) FROM t1 LEFT JOIN v2 ON t1.id=v2.id;
|
||||||
DROP VIEW v2;
|
DROP VIEW v2;
|
||||||
|
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #16069: VIEW does return the same results as underlying SELECT
|
||||||
|
# with WHERE condition containing BETWEEN over dates
|
||||||
|
|
||||||
|
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY,
|
||||||
|
td date DEFAULT NULL, KEY idx(td));
|
||||||
|
|
||||||
|
INSERT INTO t1 VALUES
|
||||||
|
(1, '2005-01-01'), (2, '2005-01-02'), (3, '2005-01-02'),
|
||||||
|
(4, '2005-01-03'), (5, '2005-01-04'), (6, '2005-01-05'),
|
||||||
|
(7, '2005-01-05'), (8, '2005-01-05'), (9, '2005-01-06');
|
||||||
|
|
||||||
|
CREATE VIEW v1 AS SELECT * FROM t1;
|
||||||
|
|
||||||
|
SELECT * FROM t1 WHERE td BETWEEN '2005.01.02' AND '2005.01.04';
|
||||||
|
SELECT * FROM v1 WHERE td BETWEEN '2005.01.02' AND '2005.01.04';
|
||||||
|
|
||||||
|
DROP VIEW v1;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
|
@ -55,8 +55,8 @@ static void agg_cmp_type(THD *thd, Item_result *type, Item **items, uint nitems)
|
||||||
bool all_constant= TRUE;
|
bool all_constant= TRUE;
|
||||||
|
|
||||||
/* If the first argument is a FIELD_ITEM, pull out the field. */
|
/* If the first argument is a FIELD_ITEM, pull out the field. */
|
||||||
if (items[0]->type() == Item::FIELD_ITEM)
|
if (items[0]->real_item()->type() == Item::FIELD_ITEM)
|
||||||
field=((Item_field *)items[0])->field;
|
field=((Item_field *)(items[0]->real_item()))->field;
|
||||||
/* But if it can't be compared as a longlong, we don't really care. */
|
/* But if it can't be compared as a longlong, we don't really care. */
|
||||||
if (field && !field->can_be_compared_as_longlong())
|
if (field && !field->can_be_compared_as_longlong())
|
||||||
field= NULL;
|
field= NULL;
|
||||||
|
|
Loading…
Reference in a new issue