summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2009-09-28 09:39:50 +0200
committerMikael Ronstrom <mikael@mysql.com>2009-09-28 09:39:50 +0200
commitccae404afaddf98c16889fdd21c613b551ee5e5e (patch)
treef7dc27f11e200c4a174df0a91afb7bbd83e5dcc5 /sql/ha_partition.h
parentec5b25954376265d187c57984d0416c50d0a1694 (diff)
parenta8edd0aabb5059935b99076fbcc92403079535df (diff)
downloadmariadb-git-ccae404afaddf98c16889fdd21c613b551ee5e5e.tar.gz
Merge to mysql-next-mr
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index 2f0ce6e7910..ea1ef4d05fc 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -176,6 +176,11 @@ private:
This to ensure it will work with statement based replication.
*/
bool auto_increment_safe_stmt_log_lock;
+ /** For optimizing ha_start_bulk_insert calls */
+ MY_BITMAP m_bulk_insert_started;
+ ha_rows m_bulk_inserted_rows;
+ /** used for prediction of start_bulk_insert rows */
+ enum_monotonicity_info m_part_func_monotonicity_info;
public:
handler *clone(MEM_ROOT *mem_root);
virtual void set_part_info(partition_info *part_info)
@@ -353,7 +358,6 @@ public:
Bulk inserts are supported if all underlying handlers support it.
start_bulk_insert and end_bulk_insert is called before and after a
number of calls to write_row.
- Not yet though.
*/
virtual int write_row(uchar * buf);
virtual int update_row(const uchar * old_data, uchar * new_data);
@@ -361,6 +365,10 @@ public:
virtual int delete_all_rows(void);
virtual void start_bulk_insert(ha_rows rows);
virtual int end_bulk_insert();
+private:
+ ha_rows guess_bulk_insert_rows();
+ void start_part_bulk_insert(uint part_id);
+public:
virtual bool is_fatal_error(int error, uint flags)
{
@@ -936,9 +944,11 @@ private:
auto_increment_lock= FALSE;
}
}
- virtual void set_auto_increment_if_higher(const ulonglong nr)
+ virtual void set_auto_increment_if_higher(Field *field)
{
HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
+ ulonglong nr= (((Field_num*) field)->unsigned_flag ||
+ field->val_int() > 0) ? field->val_int() : 0;
lock_auto_increment();
DBUG_ASSERT(ha_data->auto_inc_initialized == TRUE);
/* must check when the mutex is taken */