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
1534bb79
Commit
1534bb79
authored
Feb 03, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24035
parents
9bb750f5
e0d8e8fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
108 additions
and
1 deletion
+108
-1
mysql-test/r/update.result
mysql-test/r/update.result
+57
-0
mysql-test/t/update.test
mysql-test/t/update.test
+35
-0
sql/opt_range.cc
sql/opt_range.cc
+16
-1
No files found.
mysql-test/r/update.result
View file @
1534bb79
...
...
@@ -377,3 +377,60 @@ create table t1(f1 int, `*f2` int);
insert into t1 values (1,1);
update t1 set `*f2`=1;
drop table t1;
CREATE TABLE t1 (
request_id int unsigned NOT NULL auto_increment,
user_id varchar(12) default NULL,
time_stamp datetime NOT NULL default '0000-00-00 00:00:00',
ip_address varchar(15) default NULL,
PRIMARY KEY (request_id),
KEY user_id_2 (user_id,time_stamp)
);
INSERT INTO t1 (user_id) VALUES ('user1');
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
INSERT INTO t1(user_id) SELECT user_id FROM t1;
flush status;
SELECT user_id FROM t1 WHERE request_id=9999999999999;
user_id
show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
SELECT user_id FROM t1 WHERE request_id=999999999999999999999999999999;
user_id
show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 7
UPDATE t1 SET user_id=null WHERE request_id=9999999999999;
show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 3
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 14
UPDATE t1 SET user_id=null WHERE request_id=999999999999999999999999999999;
show status like '%Handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 3
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 21
DROP TABLE t1;
mysql-test/t/update.test
View file @
1534bb79
...
...
@@ -307,3 +307,38 @@ insert into t1 values (1,1);
update
t1
set
`*f2`
=
1
;
drop
table
t1
;
# End of 4.1 tests
#
# Bug #24035: performance degradation with condition int_field=big_decimal
#
CREATE
TABLE
t1
(
request_id
int
unsigned
NOT
NULL
auto_increment
,
user_id
varchar
(
12
)
default
NULL
,
time_stamp
datetime
NOT
NULL
default
'0000-00-00 00:00:00'
,
ip_address
varchar
(
15
)
default
NULL
,
PRIMARY
KEY
(
request_id
),
KEY
user_id_2
(
user_id
,
time_stamp
)
);
INSERT
INTO
t1
(
user_id
)
VALUES
(
'user1'
);
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
INSERT
INTO
t1
(
user_id
)
SELECT
user_id
FROM
t1
;
flush
status
;
SELECT
user_id
FROM
t1
WHERE
request_id
=
9999999999999
;
show
status
like
'%Handler_read%'
;
SELECT
user_id
FROM
t1
WHERE
request_id
=
999999999999999999999999999999
;
show
status
like
'%Handler_read%'
;
UPDATE
t1
SET
user_id
=
null
WHERE
request_id
=
9999999999999
;
show
status
like
'%Handler_read%'
;
UPDATE
t1
SET
user_id
=
null
WHERE
request_id
=
999999999999999999999999999999
;
show
status
like
'%Handler_read%'
;
DROP
TABLE
t1
;
sql/opt_range.cc
View file @
1534bb79
...
...
@@ -4296,7 +4296,22 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
err
=
value
->
save_in_field_no_warnings
(
field
,
1
);
if
(
err
>
0
&&
field
->
cmp_type
()
!=
value
->
result_type
())
{
tree
=
0
;
if
((
type
==
Item_func
::
EQ_FUNC
||
type
==
Item_func
::
EQUAL_FUNC
)
&&
value
->
result_type
()
==
item_cmp_type
(
field
->
result_type
(),
value
->
result_type
()))
{
tree
=
new
(
alloc
)
SEL_ARG
(
field
,
0
,
0
);
tree
->
type
=
SEL_ARG
::
IMPOSSIBLE
;
}
else
{
/*
TODO: We should return trees of the type SEL_ARG::IMPOSSIBLE
for the cases like int_field > 999999999999999999999999 as well.
*/
tree
=
0
;
}
goto
end
;
}
if
(
err
<
0
)
...
...
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