#At file:///export/home/didrik/repo/trunk-bug58705/ based on revid:alexander.nozdrin@stripped
3324 Tor Didriksen 2011-04-15
nullable or not nullable, that is the question
modified:
sql/event_db_repository.cc
sql/field.h
sql/sql_load.cc
storage/innobase/handler/handler0alter.cc
storage/perfschema/table_events_statements.cc
=== modified file 'sql/event_db_repository.cc'
--- a/sql/event_db_repository.cc 2011-03-21 16:24:30 +0000
+++ b/sql/event_db_repository.cc 2011-04-15 12:59:29 +0000
@@ -279,7 +279,7 @@ mysql_event_fill_row(THD *thd,
interval_type_to_name[et->interval].length,
scs);
- fields[ET_FIELD_EXECUTE_AT]->set_null();
+ // not nullable!! fields[ET_FIELD_EXECUTE_AT]->set_null();
if (!et->starts_null)
{
=== modified file 'sql/field.h'
--- a/sql/field.h 2011-03-28 08:51:35 +0000
+++ b/sql/field.h 2011-04-15 12:59:29 +0000
@@ -281,7 +281,10 @@ public:
return test(null_ptr[offset] & null_bit);
}
inline void set_null(my_ptrdiff_t row_offset= 0)
- { if (null_ptr) null_ptr[row_offset]|= null_bit; }
+ {
+ DBUG_ASSERT(real_maybe_null());
+ if (null_ptr) null_ptr[row_offset]|= null_bit;
+ }
inline void set_notnull(my_ptrdiff_t row_offset= 0)
{ if (null_ptr) null_ptr[row_offset]&= (uchar) ~null_bit; }
inline bool maybe_null(void) { return null_ptr != 0 || table->maybe_null; }
=== modified file 'sql/sql_load.cc'
--- a/sql/sql_load.cc 2011-04-15 09:02:16 +0000
+++ b/sql/sql_load.cc 2011-04-15 12:59:29 +0000
@@ -965,7 +965,8 @@ read_sep_field(THD *thd, COPY_INFO &info
thd->warning_info->current_row_for_warning());
DBUG_RETURN(1);
}
- field->set_null();
+ if (field->real_maybe_null())
+ field->set_null();
if (!field->maybe_null())
{
if (field->type() == MYSQL_TYPE_TIMESTAMP)
=== modified file 'storage/innobase/handler/handler0alter.cc'
--- a/storage/innobase/handler/handler0alter.cc 2011-03-30 12:20:45 +0000
+++ b/storage/innobase/handler/handler0alter.cc 2011-04-15 12:59:29 +0000
@@ -157,7 +157,8 @@ innobase_rec_to_mysql(
if (UNIV_UNLIKELY(ipos == ULINT_UNDEFINED)) {
null_field:
- field->set_null();
+ if (field->real_maybe_null())
+ field->set_null();
continue;
}
=== modified file 'storage/perfschema/table_events_statements.cc'
--- a/storage/perfschema/table_events_statements.cc 2011-02-14 14:23:55 +0000
+++ b/storage/perfschema/table_events_statements.cc 2011-04-15 12:59:29 +0000
@@ -411,7 +411,7 @@ int table_events_statements_common::read
if (m_row.m_lock_time != 0)
set_field_ulonglong(f, m_row.m_lock_time);
else
- f->set_null();
+ {} // not nullable!! f->set_null();
break;
case 8: /* SQL_TEXT */
if (m_row.m_sqltext_length)
Attachment: [text/bzr-bundle] bzr/tor.didriksen@oracle.com-20110415125929-8k9th78wszpj98z5.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (tor.didriksen:3324) | Tor Didriksen | 15 Apr |