diff options
author | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-07-03 17:17:58 +0500 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-07-03 17:17:58 +0500 |
commit | b16b2683e5a7e9b1eae9a59b477b8eb0517b6c68 (patch) | |
tree | 62836edad1515fad18f5c269b21e8fbb0ecd0db7 /sql/field.h | |
parent | d45d542aad19d55b1ab4242edc16133106969307 (diff) | |
download | mariadb-git-b16b2683e5a7e9b1eae9a59b477b8eb0517b6c68.tar.gz |
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
New Field::store() method implemented to explicitly set thd->count_cuted_fields
before value storing, instead of (incorrectly) setting it in the CSV storage engine.
Thread row counter now properly incremented during check and repair in the CSV engine.
include/mysql/plugin.h:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- thd_inc_row_count() function prototype added, which allows a storage
engine to increment thread row counter.
mysql-test/r/csv.result:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- result adjusted.
sql/field.cc:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- Field::store(const char *to, uint length, CHARSET_INFO *cs,
enum_check_fields check_level)
method introduced in order to explicitly set count_cuted_fields before
a ::store call, then reset it back after.
sql/field.h:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- Field::store(const char *to, uint length, CHARSET_INFO *cs,
enum_check_fields check_level)
method introduced in order to explicitly set count_cuted_fields before
a ::store call, then reset it back after.
sql/mysql_priv.h:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- enum enum_check_fields moved from sql/sql_class.h to sql/mysql_priv.h
as it's used now in the field.h
sql/sql_class.cc:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- implementation of the new thd_inc_row_count() function which increments
thread row counter.
sql/sql_class.h:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- enum enum_check_fields moved from sql/sql_class.h to sql/mysql_priv.h
as it's used now in the field.h
storage/csv/ha_tina.cc:
Complementary fix for bug #29353: inserting a negative value to a csv table
leads to the table corruption
- removed #define MYSQL_SERVER 1 - "a storage engine should not need
internals of the server"
- removed thd->count_cuted_fields= CHECK_FIELD_WARN as we are not allowed to
access internals of THD.
- used new Field::store() method to explicitly set thd->count_cuted_fields to
CHECK_FIELD_WARN
- thd_inc_row_count() calls added to ha_tina::repair() and ha_tina::check()
to get proper row count values.
Diffstat (limited to 'sql/field.h')
-rw-r--r-- | sql/field.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/field.h b/sql/field.h index a0fe0f2e57e..ef76cb47d36 100644 --- a/sql/field.h +++ b/sql/field.h @@ -100,6 +100,8 @@ public: virtual int store(longlong nr, bool unsigned_val)=0; virtual int store_decimal(const my_decimal *d)=0; virtual int store_time(MYSQL_TIME *ltime, timestamp_type t_type); + int store(const char *to, uint length, CHARSET_INFO *cs, + enum_check_fields check_level); virtual double val_real(void)=0; virtual longlong val_int(void)=0; virtual my_decimal *val_decimal(my_decimal *); |