List:Internals« Previous MessageNext Message »
From:ramil Date:January 19 2005 9:04am
Subject:bk commit into 5.0 tree (ram:1.1783)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of ram. When ram does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html

ChangeSet
  1.1783 05/01/19 12:04:35 ram@stripped +4 -0
  A fix (bug #6999: Traditional: Wrong SQLSTATE returned for string truncation).

  sql/share/errmsg.txt
    1.7 05/01/19 12:04:30 ram@stripped +2 -0
    A fix (bug #6999: Traditional: Wrong SQLSTATE returned for string truncation).
    ER_DATA_TOO_LONG (22001) has been added.

  sql/field.cc
    1.224 05/01/19 12:04:30 ram@stripped +6 -2
    A fix (bug #6999: Traditional: Wrong SQLSTATE returned for string truncation).

  mysql-test/t/strict.test
    1.10 05/01/19 12:04:30 ram@stripped +2 -2
    A fix (bug #6999: Traditional: Wrong SQLSTATE returned for string truncation).

  mysql-test/r/strict.result
    1.13 05/01/19 12:04:30 ram@stripped +2 -2
    A fix (bug #6999: Traditional: Wrong SQLSTATE returned for string truncation).

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	ram
# Host:	gw.mysql.r18.ru
# Root:	/usr/home/ram/work/5.0.b6999

--- 1.223/sql/field.cc	2005-01-14 01:48:24 +04:00
+++ 1.224/sql/field.cc	2005-01-19 12:04:30 +04:00
@@ -4368,8 +4368,12 @@
       error= 1;
   }
   if (error)
-    set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
-
+  {
+    if (table->in_use->abort_on_warning)
+      set_warning(MYSQL_ERROR::WARN_LEVEL_ERROR, ER_DATA_TOO_LONG, 1);
+    else
+      set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
+  }
   return error;
 }
 

--- 1.6/sql/share/errmsg.txt	2005-01-13 21:09:25 +04:00
+++ 1.7/sql/share/errmsg.txt	2005-01-19 12:04:30 +04:00
@@ -5210,3 +5210,5 @@
 	eng "Failed to grant EXECUTE and ALTER ROUTINE privileges"
 ER_PROC_AUTO_REVOKE_FAIL
 	eng "Failed to revoke all privileges to dropped routine"
+ER_DATA_TOO_LONG 22001
+	eng "Data too long for column '%s' at row %ld"

--- 1.12/mysql-test/r/strict.result	2005-01-11 22:52:13 +04:00
+++ 1.13/mysql-test/r/strict.result	2005-01-19 12:04:30 +04:00
@@ -814,14 +814,14 @@
 CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
 INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello   ', 'hello ');
 INSERT INTO t1 (col1) VALUES ('hellobob');
-ERROR 01000: Data truncated for column 'col1' at row 1
+ERROR 22001: Data too long for column 'col1' at row 1
 INSERT INTO t1 (col2) VALUES ('hellobob');
 ERROR 01000: Data truncated for column 'col2' at row 1
 INSERT INTO t1 (col2) VALUES ('hello  ');
 Warnings:
 Note	1265	Data truncated for column 'col2' at row 1
 UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
-ERROR 01000: Data truncated for column 'col1' at row 2
+ERROR 22001: Data too long for column 'col1' at row 2
 UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
 ERROR 01000: Data truncated for column 'col2' at row 2
 INSERT IGNORE INTO t1 VALUES ('hellobob', 'hellobob');

--- 1.9/mysql-test/t/strict.test	2005-01-11 22:51:52 +04:00
+++ 1.10/mysql-test/t/strict.test	2005-01-19 12:04:30 +04:00
@@ -565,12 +565,12 @@
 
 CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
 INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello   ', 'hello ');
---error 1265
+--error 1400
 INSERT INTO t1 (col1) VALUES ('hellobob');
 --error 1265
 INSERT INTO t1 (col2) VALUES ('hellobob');
 INSERT INTO t1 (col2) VALUES ('hello  ');
---error 1265
+--error 1400
 UPDATE t1 SET col1 ='hellobob' WHERE col1 ='he';
 --error 1265
 UPDATE t1 SET col2 ='hellobob' WHERE col2 ='he';
Thread
bk commit into 5.0 tree (ram:1.1783)ramil19 Jan