Below is the list of changes that have just been committed into a local
5.1 repository of mikron. When mikron does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1805 05/05/07 10:32:11 mronstrom@stripped +4 -0
Added lots of TODO after review
sql/table.cc
1.181 05/05/07 10:32:00 mronstrom@stripped +1 -0
Added lots of TODO after review
sql/sql_update.cc
1.157 05/05/07 10:32:00 mronstrom@stripped +1 -1
Added lots of TODO after review
sql/ha_partition.h
1.34 05/05/07 10:32:00 mronstrom@stripped +3 -0
Added lots of TODO after review
sql/ha_partition.cc
1.36 05/05/07 10:31:59 mronstrom@stripped +18 -11
Added lots of TODO after review
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: mronstrom
# Host: mikael-ronstr-ms-dator.local
# Root: /Users/mikron/wl1354_new
--- 1.156/sql/sql_update.cc Tue Apr 26 14:31:05 2005
+++ 1.157/sql/sql_update.cc Sat May 7 10:32:00 2005
@@ -146,7 +146,7 @@
/* pass counter value */
thd->lex->table_count= table_count;
/* convert to multiupdate */
- return 2;
+ DBUG_RETURN(2);
}
if (lock_tables(thd, table_list, table_count) ||
--- 1.180/sql/table.cc Thu May 5 10:12:49 2005
+++ 1.181/sql/table.cc Sat May 7 10:32:00 2005
@@ -441,6 +441,7 @@
/*
Prepare for calling val_int on partition function by setting fields to
point to the record where the values of the PF-fields are stored.
+ TODO RONM: Use move_field instead for change of field->ptr
*/
void set_field_ptr(Field **ptr, const byte *new_buf, const byte *old_buf)
{
--- 1.35/sql/ha_partition.cc Tue Apr 26 14:16:48 2005
+++ 1.36/sql/ha_partition.cc Sat May 7 10:31:59 2005
@@ -136,6 +136,10 @@
m_key_len_buf= 0;
}
+/*
+ TODO RONM: Use memroot (need to save memroot to ensure I use the same
+ memroot in all places) for memory allocation.
+*/
ha_partition::~ha_partition()
{
DBUG_ENTER("ha_partition::~ha_partition()");
@@ -881,6 +885,10 @@
time). In the future we will probably try to remove this.
Called from lock.cc by get_lock_data().
+
+ TODO RONM Only needed to use one at the moment or call store_lock on
+ one handler or get the maximum lock value back in a loop. Need to
+ change lock_count if this is changed.
*/
THR_LOCK_DATA **ha_partition::store_lock(THD *thd,
THR_LOCK_DATA **to,
@@ -920,6 +928,9 @@
/*
Record currently processed was not in the result set of the statement
and is thus unlocked. Used for UPDATE and DELETE queries.
+
+ TODO RONM: Call underlying handler at least if it is InnoDB, not a bug
+ but an improvement.
*/
void ha_partition::unlock_row()
{
@@ -977,7 +988,7 @@
int error;
byte *rec0= table->record[0];
DBUG_ENTER("ha_partition::write_row");
- if (buf == rec0)
+ if (likely(buf == rec0))
error=get_partition_id(m_part_info, &part_id);
else
{
@@ -985,7 +996,7 @@
error= get_partition_id(m_part_info, &part_id);
set_field_ptr(rec0, buf);
}
- if (error)
+ if (unlikely(error))
DBUG_RETURN(error);
DBUG_PRINT("info", ("Insert in partition %d", part_id));
DBUG_RETURN(m_file[part_id]->write_row(buf));
@@ -1360,15 +1371,8 @@
DBUG_ENTER("ha_partition::rnd_pos");
part_id=get_part_id_from_pos((const byte*)pos);
file= m_file[part_id];
- if (part_id < m_tot_parts)
- {
- DBUG_RETURN(file->rnd_pos(buf, (pos + PARTITION_BYTES_IN_POS)));
- }
- else
- {
- DBUG_ASSERT(FALSE);
- DBUG_RETURN(TRUE);
- }
+ DBUG_ASSERT(part_id < m_tot_parts);
+ DBUG_RETURN(file->rnd_pos(buf, (pos + PARTITION_BYTES_IN_POS)));
}
/*
@@ -2273,6 +2277,7 @@
HA_STATUS_NO_LOCK:
This is declared and often used. It is however not implemented by
any handler so can be safely ignored also by the partition handler.
+ TODO RONM: Remove these flags completely
*/
DBUG_ENTER("ha_partition:info");
uint i;
@@ -2331,6 +2336,8 @@
/*
Recalculate loads of constant variables. MyISAM also sets things
directly on the table share object.
+ TODO: Check whether this should be fixed since handlers should not
+ change things directly on the table object.
The only real important parameter set here is records per key on
all indexes.
--- 1.33/sql/ha_partition.h Tue Apr 26 14:16:48 2005
+++ 1.34/sql/ha_partition.h Sat May 7 10:32:00 2005
@@ -275,6 +275,7 @@
The position can be a file position, a primary key, a ROWID dependent
on the handler below.
-------------------------------------------------------------------------
+ */
/*
unlike index_init(), rnd_init() can be called two times
without rnd_end() in between (it only makes sense if scan=1).
@@ -559,6 +560,8 @@
HA_DUPP_POS:
MyISAM specific feature used in sql_insert.cc to handle duplicate
records.
+ After a duplicate error on update/insert you can get the position of
+ this row by calling position(..).
Further investigation needed.
(MyISAM)
HA_CAN_INDEX_BLOBS:
| Thread |
|---|
| • bk commit into 5.1 tree (mronstrom:1.1805) | mikael | 7 May |