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
a2e7f632
Commit
a2e7f632
authored
May 27, 2010
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
71e53454
1d0acc77
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
1 deletion
+46
-1
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+9
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+14
-0
sql/sql_update.cc
sql/sql_update.cc
+1
-1
sql/table.cc
sql/table.cc
+21
-0
sql/table.h
sql/table.h
+1
-0
No files found.
mysql-test/r/innodb_mysql.result
View file @
a2e7f632
...
...
@@ -2413,6 +2413,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
DROP TABLE t1,t2;
#
# Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index))
#
CREATE TABLE t1 (a INT, b INT, c INT, d INT,
PRIMARY KEY(a,b,c), KEY(b,d))
ENGINE=InnoDB;
INSERT INTO t1 VALUES (0, 77, 1, 3);
UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
DROP TABLE t1;
End of 5.1 tests
#
# Test for bug #39932 "create table fails if column for FK is in different
...
...
mysql-test/t/innodb_mysql.test
View file @
a2e7f632
...
...
@@ -649,6 +649,20 @@ EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# Bug #53830: !table || (!table->read_set || bitmap_is_set(table->read_set, field_index))
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
c
INT
,
d
INT
,
PRIMARY
KEY
(
a
,
b
,
c
),
KEY
(
b
,
d
))
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
0
,
77
,
1
,
3
);
UPDATE
t1
SET
d
=
0
WHERE
b
=
77
AND
c
=
25
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
...
...
sql/sql_update.cc
View file @
a2e7f632
...
...
@@ -408,7 +408,7 @@ int mysql_update(THD *thd,
matching rows before updating the table!
*/
if
(
used_index
<
MAX_KEY
&&
old_covering_keys
.
is_set
(
used_index
))
table
->
mark
_columns_used_by_index
(
used_index
);
table
->
add_read
_columns_used_by_index
(
used_index
);
else
{
table
->
use_all_columns
();
...
...
sql/table.cc
View file @
a2e7f632
...
...
@@ -4437,6 +4437,27 @@ void TABLE::mark_columns_used_by_index(uint index)
}
/*
Add fields used by a specified index to the table's read_set.
NOTE:
The original state can be restored with
restore_column_maps_after_mark_index().
*/
void
st_table
::
add_read_columns_used_by_index
(
uint
index
)
{
MY_BITMAP
*
bitmap
=
&
tmp_set
;
DBUG_ENTER
(
"st_table::add_read_columns_used_by_index"
);
set_keyread
(
TRUE
);
bitmap_copy
(
bitmap
,
read_set
);
mark_columns_used_by_index_no_reset
(
index
,
bitmap
);
column_bitmaps_set
(
bitmap
,
write_set
);
DBUG_VOID_RETURN
;
}
/*
Restore to use normal column maps after key read
...
...
sql/table.h
View file @
a2e7f632
...
...
@@ -1049,6 +1049,7 @@ public:
void
prepare_for_position
(
void
);
void
mark_columns_used_by_index_no_reset
(
uint
index
,
MY_BITMAP
*
map
);
void
mark_columns_used_by_index
(
uint
index
);
void
add_read_columns_used_by_index
(
uint
index
);
void
restore_column_maps_after_mark_index
();
void
mark_auto_increment_column
(
void
);
void
mark_columns_needed_for_update
(
void
);
...
...
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