summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2009-12-17 18:09:04 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2009-12-17 18:09:04 +0300
commit5069a666709a66335ded54c6fab4832e155840c1 (patch)
tree4d0f676967368da9dbb6b7ddde1033a278f2e17c /sql/sql_insert.cc
parent7e15d855f1fbc72bae6c0ee75dd2b61477c2eaff (diff)
parent709f49cbf780681bb74707c9ab2438f163747906 (diff)
downloadmariadb-git-5069a666709a66335ded54c6fab4832e155840c1.tar.gz
Automerge from mysql-5.1-bugteam to mysql-trunk-merge.
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index d4306ba0c61..76d2bab6ded 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -800,12 +800,21 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
restore_record(table,s->default_values); // Get empty record
else
{
+ TABLE_SHARE *share= table->s;
+
/*
Fix delete marker. No need to restore rest of record since it will
be overwritten by fill_record() anyway (and fill_record() does not
use default values in this case).
*/
- table->record[0][0]= table->s->default_values[0];
+ table->record[0][0]= share->default_values[0];
+
+ /* Fix undefined null_bits. */
+ if (share->null_bytes > 1 && share->last_null_bit_pos)
+ {
+ table->record[0][share->null_bytes - 1]=
+ share->default_values[share->null_bytes - 1];
+ }
}
if (fill_record_n_invoke_before_triggers(thd, table->field, *values, 0,
table->triggers,