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
1fd3958e
Commit
1fd3958e
authored
Sep 04, 2006
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0-opt
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
parents
d253cf78
55163a36
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
104 additions
and
7 deletions
+104
-7
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+6
-0
mysql-test/r/range.result
mysql-test/r/range.result
+45
-0
mysql-test/t/range.test
mysql-test/t/range.test
+29
-0
sql/item_sum.cc
sql/item_sum.cc
+3
-1
sql/opt_range.cc
sql/opt_range.cc
+8
-1
sql/sql_lex.cc
sql/sql_lex.cc
+4
-4
sql/sql_lex.h
sql/sql_lex.h
+7
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+2
-0
No files found.
mysql-test/r/query_cache.result
View file @
1fd3958e
...
...
@@ -947,18 +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'
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'
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'
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
...
...
mysql-test/r/range.result
View file @
1fd3958e
...
...
@@ -896,3 +896,48 @@ EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge idx1,idx2 idx1,idx2 4,4 NULL 4 Using sort_union(idx1,idx2); Using where
DROP TABLE t1;
CREATE TABLE t1 (
item char(20) NOT NULL default '',
started datetime NOT NULL default '0000-00-00 00:00:00',
price decimal(16,3) NOT NULL default '0.000',
PRIMARY KEY (item,started)
) ENGINE=MyISAM;
INSERT INTO t1 VALUES
('A1','2005-11-01 08:00:00',1000),
('A1','2005-11-15 00:00:00',2000),
('A1','2005-12-12 08:00:00',3000),
('A2','2005-12-01 08:00:00',1000);
EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 2 Using where
Warnings:
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
item started price
A1 2005-11-01 08:00:00 1000.000
A1 2005-11-15 00:00:00 2000.000
Warnings:
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
item started price
A1 2005-11-01 08:00:00 1000.000
A1 2005-11-15 00:00:00 2000.000
DROP INDEX `PRIMARY` ON t1;
EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
Warnings:
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00';
item started price
A1 2005-11-01 08:00:00 1000.000
A1 2005-11-15 00:00:00 2000.000
Warnings:
Warning 1292 Incorrect datetime value: '2005-12-01 24:00:00' for column 'started' at row 1
SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-02 00:00:00';
item started price
A1 2005-11-01 08:00:00 1000.000
A1 2005-11-15 00:00:00 2000.000
DROP TABLE t1;
mysql-test/t/range.test
View file @
1fd3958e
...
...
@@ -709,5 +709,34 @@ EXPLAIN SELECT * FROM t1 WHERE 0 NOT BETWEEN b AND c;
DROP
TABLE
t1
;
#
# Bug #16249: different results for a range with an without index
# when a range condition use an invalid datetime constant
#
CREATE
TABLE
t1
(
item
char
(
20
)
NOT
NULL
default
''
,
started
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
price
decimal
(
16
,
3
)
NOT
NULL
default
'0.000'
,
PRIMARY
KEY
(
item
,
started
)
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
'A1'
,
'2005-11-01 08:00:00'
,
1000
),
(
'A1'
,
'2005-11-15 00:00:00'
,
2000
),
(
'A1'
,
'2005-12-12 08:00:00'
,
3000
),
(
'A2'
,
'2005-12-01 08:00:00'
,
1000
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
item
=
'A1'
AND
started
<=
'2005-12-01 24:00:00'
;
SELECT
*
FROM
t1
WHERE
item
=
'A1'
AND
started
<=
'2005-12-01 24:00:00'
;
SELECT
*
FROM
t1
WHERE
item
=
'A1'
AND
started
<=
'2005-12-02 00:00:00'
;
DROP
INDEX
`PRIMARY`
ON
t1
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
item
=
'A1'
AND
started
<=
'2005-12-01 24:00:00'
;
SELECT
*
FROM
t1
WHERE
item
=
'A1'
AND
started
<=
'2005-12-01 24:00:00'
;
SELECT
*
FROM
t1
WHERE
item
=
'A1'
AND
started
<=
'2005-12-02 00:00:00'
;
DROP
TABLE
t1
;
# End of 5.0 tests
sql/item_sum.cc
View file @
1fd3958e
...
...
@@ -290,7 +290,9 @@ Item_sum::Item_sum(THD *thd, Item_sum *item):
void
Item_sum
::
mark_as_sum_func
()
{
current_thd
->
lex
->
current_select
->
with_sum_func
=
1
;
SELECT_LEX
*
cur_select
=
current_thd
->
lex
->
current_select
;
cur_select
->
n_sum_items
++
;
cur_select
->
with_sum_func
=
1
;
with_sum_func
=
1
;
}
...
...
sql/opt_range.cc
View file @
1fd3958e
...
...
@@ -4129,6 +4129,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
MEM_ROOT
*
alloc
=
param
->
mem_root
;
char
*
str
;
ulong
orig_sql_mode
;
int
err
;
DBUG_ENTER
(
"get_mm_leaf"
);
/*
...
...
@@ -4280,7 +4281,13 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
(
field
->
type
()
==
FIELD_TYPE_DATE
||
field
->
type
()
==
FIELD_TYPE_DATETIME
))
field
->
table
->
in_use
->
variables
.
sql_mode
|=
MODE_INVALID_DATES
;
if
(
value
->
save_in_field_no_warnings
(
field
,
1
)
<
0
)
err
=
value
->
save_in_field_no_warnings
(
field
,
1
);
if
(
err
>
0
&&
field
->
cmp_type
()
!=
value
->
result_type
())
{
tree
=
0
;
goto
end
;
}
if
(
err
<
0
)
{
field
->
table
->
in_use
->
variables
.
sql_mode
=
orig_sql_mode
;
/* This happens when we try to insert a NULL field in a not null column */
...
...
sql/sql_lex.cc
View file @
1fd3958e
...
...
@@ -1524,10 +1524,10 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
*/
Query_arena
*
arena
=
thd
->
stmt_arena
;
return
(
ref_pointer_array
=
(
Item
**
)
arena
->
alloc
(
sizeof
(
Item
*
)
*
(
item_list
.
elements
+
(
Item
**
)
arena
->
alloc
(
sizeof
(
Item
*
)
*
(
n_child_sum_items
+
item_list
.
elements
+
select_n_having_items
+
order_group_num
)
*
5
))
==
0
;
order_group_num
)
*
5
))
==
0
;
}
...
...
sql/sql_lex.h
View file @
1fd3958e
...
...
@@ -548,6 +548,12 @@ public:
bool
braces
;
/* SELECT ... UNION (SELECT ... ) <- this braces */
/* TRUE when having fix field called in processing of this SELECT */
bool
having_fix_field
;
/* Number of Item_sum-derived objects in this SELECT */
uint
n_sum_items
;
/* Number of Item_sum-derived objects in children and descendant SELECTs */
uint
n_child_sum_items
;
/* explicit LIMIT clause was used */
bool
explicit_limit
;
/*
...
...
@@ -640,7 +646,7 @@ public:
bool
test_limit
();
friend
void
lex_start
(
THD
*
thd
,
uchar
*
buf
,
uint
length
);
st_select_lex
()
{}
st_select_lex
()
:
n_sum_items
(
0
),
n_child_sum_items
(
0
)
{}
void
make_empty_select
()
{
init_query
();
...
...
sql/sql_yacc.yy
View file @
1fd3958e
...
...
@@ -8954,8 +8954,10 @@ subselect_end:
{
LEX *lex=Lex;
lex->pop_context();
SELECT_LEX *child= lex->current_select;
lex->current_select = lex->current_select->return_after_parsing();
lex->nest_level--;
lex->current_select->n_child_sum_items += child->n_sum_items;
};
/**************************************************************************
...
...
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