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
9e2bafbc
Commit
9e2bafbc
authored
Mar 13, 2006
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jimw/my/mysql-5.1-14526
into mysql.com:/home/jimw/my/mysql-5.1-clean
parents
f9fa05a0
0e06bebe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
11 deletions
+43
-11
mysql-test/r/partition.result
mysql-test/r/partition.result
+18
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+12
-0
sql/ha_partition.cc
sql/ha_partition.cc
+13
-11
No files found.
mysql-test/r/partition.result
View file @
9e2bafbc
...
@@ -433,4 +433,22 @@ show table status like 't1';
...
@@ -433,4 +433,22 @@ show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 PARTITION 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
t1 PARTITION 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL
drop table t1;
drop table t1;
create table t2 (s1 int not null auto_increment, primary key (s1)) partition by list (s1) (partition p1 values in (1),partition p2 values in (2),partition p3 values in (3),partition p4 values in (4));
insert into t2 values (null),(null),(null);
select * from t2;
s1
1
2
3
select * from t2 where s1 < 2;
s1
1
update t2 set s1 = s1 + 1 order by s1 desc;
select * from t2 where s1 < 3;
s1
2
select * from t2 where s1 = 2;
s1
2
drop table t2;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/partition.test
View file @
9e2bafbc
...
@@ -559,4 +559,16 @@ create table t1 (a int) engine=innodb partition by hash(a) ;
...
@@ -559,4 +559,16 @@ create table t1 (a int) engine=innodb partition by hash(a) ;
show
table
status
like
't1'
;
show
table
status
like
't1'
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #14526: Partitions: indexed searches fail
#
create
table
t2
(
s1
int
not
null
auto_increment
,
primary
key
(
s1
))
partition
by
list
(
s1
)
(
partition
p1
values
in
(
1
),
partition
p2
values
in
(
2
),
partition
p3
values
in
(
3
),
partition
p4
values
in
(
4
));
insert
into
t2
values
(
null
),(
null
),(
null
);
select
*
from
t2
;
select
*
from
t2
where
s1
<
2
;
update
t2
set
s1
=
s1
+
1
order
by
s1
desc
;
select
*
from
t2
where
s1
<
3
;
select
*
from
t2
where
s1
=
2
;
drop
table
t2
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/ha_partition.cc
View file @
9e2bafbc
...
@@ -2603,22 +2603,13 @@ void ha_partition::unlock_row()
...
@@ -2603,22 +2603,13 @@ void ha_partition::unlock_row()
ha_berkeley.cc has a variant of how to store it intact by "packing" it
ha_berkeley.cc has a variant of how to store it intact by "packing" it
for ha_berkeley's own native storage type.
for ha_berkeley's own native storage type.
See the note for update_row() on auto_increments and timestamps. This
case also applied to write_row().
Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc,
Called from item_sum.cc, item_sum.cc, sql_acl.cc, sql_insert.cc,
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
sql_insert.cc, sql_select.cc, sql_table.cc, sql_udf.cc, and sql_update.cc.
ADDITIONAL INFO:
ADDITIONAL INFO:
Most handlers set timestamp when calling write row if any such fields
We have to set timestamp fields and auto_increment fields, because those
exists. Since we are calling an underlying handler we assume the´
may be used in determining which partition the row should be written to.
underlying handler will assume this responsibility.
Underlying handlers will also call update_auto_increment to calculate
the new auto increment value. We will catch the call to
get_auto_increment and ensure this increment value is maintained by
only one of the underlying handlers.
*/
*/
int
ha_partition
::
write_row
(
byte
*
buf
)
int
ha_partition
::
write_row
(
byte
*
buf
)
...
@@ -2632,6 +2623,17 @@ int ha_partition::write_row(byte * buf)
...
@@ -2632,6 +2623,17 @@ int ha_partition::write_row(byte * buf)
DBUG_ENTER
(
"ha_partition::write_row"
);
DBUG_ENTER
(
"ha_partition::write_row"
);
DBUG_ASSERT
(
buf
==
m_rec0
);
DBUG_ASSERT
(
buf
==
m_rec0
);
/* If we have a timestamp column, update it to the current time */
if
(
table
->
timestamp_field_type
&
TIMESTAMP_AUTO_SET_ON_INSERT
)
table
->
timestamp_field
->
set_time
();
/*
If we have an auto_increment column and we are writing a changed row
or a new row, then update the auto_increment value in the record.
*/
if
(
table
->
next_number_field
&&
buf
==
table
->
record
[
0
])
update_auto_increment
();
#ifdef NOT_NEEDED
#ifdef NOT_NEEDED
if
(
likely
(
buf
==
rec0
))
if
(
likely
(
buf
==
rec0
))
#endif
#endif
...
...
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