Code review comment for lp:~tsarev/percona-server/18205_07_slave_type_conversions_error_on_truncate.patch

Revision history for this message
Alexey Kopytov (akopytov) wrote :

Don't touch upstream code unless you really have to. Fixing some whitespace in the upstream code is just not worth possible merge conflicts in the future.

That is, remove the following:

> -@@ -6027,8 +6539,13 @@
> +@@ -5908,8 +6407,7 @@
> + char buff[MAX_DATE_STRING_REP_LENGTH];
> + String str(buff, sizeof(buff), &my_charset_latin1);
> + make_datetime((DATE_TIME_FORMAT *) 0, ltime, &str);
> +- set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_NOTE,
> +- WARN_DATA_TRUNCATED,
> ++ set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_NOTE, WARN_DATA_TRUNCATED,
> + str.ptr(), str.length(), MYSQL_TIMESTAMP_DATE, 1);
> + error= 3;
> + }
> +@@ -6027,8 +6525,13 @@
> ** Stored as a 8 byte unsigned int. Should sometimes be change to a 6 byte int.

and this

> -@@ -7096,8 +7665,13 @@
> +@@ -6608,7 +7164,7 @@
> + String tmp(buf, sizeof(buf), cs);
> + tmp.copy((char*) ptr, field_length, cs);
> + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
> +- ER_TRUNCATED_WRONG_VALUE,
> ++ ER_TRUNCATED_WRONG_VALUE,
> + ER(ER_TRUNCATED_WRONG_VALUE),
> + "DOUBLE", tmp.c_ptr());
> + }
> +@@ -6626,7 +7182,7 @@
> +
> + result= my_strntoll(cs, (char*) ptr,field_length,10,&end,&error);
> + if (!table->in_use->no_errors &&
> +- (error || (field_length != (uint32)(end - (char*) ptr) &&
> ++ (error || (field_length != (uint32)(end - (char*) ptr) &&
> + !check_if_only_end_space(cs, end,
> + (char*) ptr + field_length))))
> + {
> +@@ -6634,7 +7190,7 @@
> + String tmp(buf, sizeof(buf), cs);
> + tmp.copy((char*) ptr, field_length, cs);
> + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
> +- ER_TRUNCATED_WRONG_VALUE,
> ++ ER_TRUNCATED_WRONG_VALUE,
> + ER(ER_TRUNCATED_WRONG_VALUE),
> + "INTEGER", tmp.c_ptr());
> + }
> +@@ -6673,7 +7229,7 @@
> + String tmp(buf, sizeof(buf), cs);
> + tmp.copy((char*) ptr, field_length, cs);
> + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
> +- ER_TRUNCATED_WRONG_VALUE,
> ++ ER_TRUNCATED_WRONG_VALUE,
> + ER(ER_TRUNCATED_WRONG_VALUE),
> + "DECIMAL", tmp.c_ptr());
> + }
> +@@ -7095,8 +7651,13 @@
> return 2;

and this

> -@@ -8553,32 +9167,50 @@
> +@@ -8533,7 +9134,7 @@
> +
> + /* Convert character set if necessary */
> + if (String::needs_conversion(length, cs, field_charset, &not_used))
> +- {
> ++ {
> + uint dummy_errors;
> + tmpstr.copy(from, length, cs, field_charset, &dummy_errors);
> + from= tmpstr.ptr();
> +@@ -8552,32 +9153,50 @@
> tmp=(uint) my_strntoul(cs,from,length,10,&end,&err);

and this

> - tmp=0;
> +- tmp=0;
> ++ tmp=0;
> + if (truncated)

and this

> +@@ -9097,15 +9736,20 @@
> + }
> +
> +
> +-uint Field_bit::is_equal(Create_field *new_field)
> ++uint Field_bit::is_equal(Create_field *new_field)
> + {
> + return (new_field->sql_type == real_type() &&
> + new_field->length == max_display_length());
> + }
> +
> +-
> -int Field_bit::store(const char *from, uint length, CHARSET_INFO *cs)

review: Needs Fixing

« Back to merge proposal