summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gkodinov@dl145s.mysql.com>2006-09-18 12:14:27 +0200
committerunknown <gkodinov@dl145s.mysql.com>2006-09-18 12:14:27 +0200
commit4c8e0e192b315d8730e5dab9c757b9409ba7bdfb (patch)
tree126c4144a479c5aeb28b5a9761bc525e05fd9dc6
parent7a0f9c8d4c02826d7fec0d3027dcac7bd1be7bc7 (diff)
downloadmariadb-git-4c8e0e192b315d8730e5dab9c757b9409ba7bdfb.tar.gz
merge fixes
-rw-r--r--mysql-test/r/func_time.result7
-rw-r--r--mysql-test/r/query_cache.result12
-rw-r--r--mysql-test/r/subselect.result4
-rw-r--r--mysql-test/r/view.result4
-rw-r--r--mysql-test/t/func_time.test2
-rw-r--r--mysql-test/t/view.test4
-rw-r--r--sql/item_cmpfunc.cc4
-rw-r--r--sql/opt_range.cc15
-rw-r--r--sql/opt_range.h2
9 files changed, 20 insertions, 34 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index e0e0eb68aa1..9fea857e4e5 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -867,12 +867,11 @@ f1
select f1 from t1 where cast("2006-1-1" as date) between date(f1) and date(f3);
f1
2006-01-01
-select f1 from t1 where cast("2006-1-1" as date) between f1 and 'zzz';
+select f1 from t1 where cast("2006-1-1" as date) between f1 and cast('zzz' as date);
f1
Warnings:
-Warning 1292 Incorrect date value: 'zzz' for column 'f1' at row 1
-Warning 1292 Truncated incorrect DOUBLE value: 'zzz'
-Warning 1292 Truncated incorrect DOUBLE value: 'zzz'
+Warning 1292 Truncated incorrect datetime value: 'zzz'
+Warning 1292 Truncated incorrect datetime value: 'zzz'
select f1 from t1 where makedate(2006,1) between date(f1) and date(f3);
f1
2006-01-01
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index a735b52a26f..5224280e134 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -947,24 +947,24 @@ COUNT(*)
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
-Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
-Warning 1292 Truncated incorrect DOUBLE value: '20050328 invalid'
-Warning 1292 Truncated incorrect DOUBLE value: '20050328 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050328 invalid'
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
-Warning 1292 Truncated incorrect DOUBLE value: '20050327 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
+Warning 1292 Truncated incorrect INTEGER value: '20050327 invalid'
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 3fdf0a6d8ff..c6a31856a24 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2947,7 +2947,7 @@ ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 DEPENDENT SUBQUERY t2 range b b 38 NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 range b b 40 NULL 2 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -2959,7 +2959,7 @@ ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 DEPENDENT SUBQUERY t2 range b b 38 NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 range b b 40 NULL 2 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 72e84884b2e..9c05aba168c 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2586,13 +2586,13 @@ INSERT INTO t1 VALUES
(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 t1 WHERE td BETWEEN CAST('2005.01.02' AS DATE) AND CAST('2005.01.04' AS DATE);
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';
+SELECT * FROM v1 WHERE td BETWEEN CAST('2005.01.02' AS DATE) AND CAST('2005.01.04' AS DATE);
id td
2 2005-01-02
3 2005-01-02
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index fe34480d5d3..7303be31e03 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -432,7 +432,7 @@ select f3 from t1 where f3 between cast("2006-1-1 12:1:1" as datetime) and cast(
select f3 from t1 where timestamp(f3) between cast("2006-1-1 12:1:1" as datetime) and cast("2006-1-1 12:1:2" as datetime);
select f1 from t1 where cast("2006-1-1" as date) between f1 and f3;
select f1 from t1 where cast("2006-1-1" as date) between date(f1) and date(f3);
-select f1 from t1 where cast("2006-1-1" as date) between f1 and 'zzz';
+select f1 from t1 where cast("2006-1-1" as date) between f1 and cast('zzz' as date);
select f1 from t1 where makedate(2006,1) between date(f1) and date(f3);
select f1 from t1 where makedate(2006,2) between date(f1) and date(f3);
drop table t1;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index e299b86c4e6..4745804e847 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2449,8 +2449,8 @@ INSERT INTO t1 VALUES
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';
+SELECT * FROM t1 WHERE td BETWEEN CAST('2005.01.02' AS DATE) AND CAST('2005.01.04' AS DATE);
+SELECT * FROM v1 WHERE td BETWEEN CAST('2005.01.02' AS DATE) AND CAST('2005.01.04' AS DATE);
DROP VIEW v1;
DROP TABLE t1;
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 122f755d5c1..780d70d51dc 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1112,7 +1112,9 @@ void Item_func_between::fix_length_and_dec()
They are compared as integers, so for const item this time-consuming
conversion can be done only once, not for every single comparison
*/
- if (args[0]->type() == FIELD_ITEM)
+ if (args[0]->type() == FIELD_ITEM &&
+ thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
+ thd->lex->sql_command != SQLCOM_SHOW_CREATE)
{
Field *field=((Item_field*) args[0])->field;
if (field->can_be_compared_as_longlong())
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 1ed74c6de2e..93566dbc281 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -6724,15 +6724,6 @@ int QUICK_RANGE_SELECT::get_next()
}
}
-void QUICK_SELECT::reset(void)
-{
- next= 0;
- it.rewind();
- range= 0;
- if (file->inited == handler::NONE)
- file->ha_index_init(index);
-}
-
/*
Get the next record with a different prefix.
@@ -9386,12 +9377,6 @@ static void print_ror_scans_arr(TABLE *table, const char *msg,
DBUG_VOID_RETURN;
}
-void QUICK_SELECT_DESC::reset(void)
-{
- rev_it.rewind();
- QUICK_SELECT::reset();
-}
-
/*****************************************************************************
** Print a quick range for debugging
** TODO:
diff --git a/sql/opt_range.h b/sql/opt_range.h
index c1f1b63d468..9474f2d469f 100644
--- a/sql/opt_range.h
+++ b/sql/opt_range.h
@@ -668,7 +668,7 @@ private:
#ifdef NOT_USED
bool test_if_null_range(QUICK_RANGE *range, uint used_key_parts);
#endif
- void reset(void);
+ int reset(void) { rev_it.rewind(); return QUICK_RANGE_SELECT::reset(); }
List<QUICK_RANGE> rev_ranges;
List_iterator<QUICK_RANGE> rev_it;
};