#At file:///home/marty/MySQL/mysql-5.1-telco-6.2/
3015 Martin Skold 2009-10-07
Bug#35990 Error code 1062 to 1296 (unknown) after setting sql_mode to STRICT_TRANS_TABLES: Disable ndb error warnings in strict mode
modified:
mysql-test/suite/ndb/r/ndb_insert.result
mysql-test/suite/ndb/t/ndb_insert.test
sql/ha_ndbcluster.cc
=== modified file 'mysql-test/suite/ndb/r/ndb_insert.result'
--- a/mysql-test/suite/ndb/r/ndb_insert.result 2008-11-24 17:57:50 +0000
+++ b/mysql-test/suite/ndb/r/ndb_insert.result 2009-10-07 15:53:06 +0000
@@ -661,3 +661,11 @@ a b
2 NULL
3 NULL
drop table t1;
+create table t1(code varchar(64) not null, PRIMARY KEY (code)) ENGINE=NDBCluster;
+insert into t1 values ('code');
+insert into t1 values ('code');
+ERROR 23000: Duplicate entry 'code' for key 'PRIMARY'
+set sql_mode='STRICT_TRANS_TABLES';
+insert into t1 values ('code');
+ERROR 23000: Duplicate entry 'code' for key 'PRIMARY'
+drop table t1;
=== modified file 'mysql-test/suite/ndb/t/ndb_insert.test'
--- a/mysql-test/suite/ndb/t/ndb_insert.test 2008-10-15 12:24:10 +0000
+++ b/mysql-test/suite/ndb/t/ndb_insert.test 2009-10-07 15:53:06 +0000
@@ -643,3 +643,18 @@ insert ignore into t1 values (1,0), (2,0
select * from t1 order by a;
drop table t1;
# End of 4.1 tests
+
+#
+# Bug #35990 Error code 1062 to 1296 (unknown) after setting sql_mode to STRICT_TRANS_TABLES
+#
+
+create table t1(code varchar(64) not null, PRIMARY KEY (code)) ENGINE=NDBCluster;
+
+insert into t1 values ('code');
+--error ER_DUP_ENTRY
+insert into t1 values ('code');
+
+set sql_mode='STRICT_TRANS_TABLES';
+--error ER_DUP_ENTRY
+insert into t1 values ('code');
+drop table t1;
\ No newline at end of file
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2009-09-24 14:32:40 +0000
+++ b/sql/ha_ndbcluster.cc 2009-10-07 15:53:06 +0000
@@ -253,18 +253,25 @@ static int ndb_to_mysql_error(const NdbE
}
/*
- Push the NDB error message as warning
- - Used to be able to use SHOW WARNINGS toget more info on what the error is
- - Used by replication to see if the error was temporary
- */
- if (ndberr->status == NdbError::TemporaryError)
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
- ndberr->code, ndberr->message, "NDB");
- else
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
- ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
- ndberr->code, ndberr->message, "NDB");
+ If we don't abort directly on warnings push a warning
+ with the internal error information
+ */
+ if (!current_thd->abort_on_warning)
+ {
+ /*
+ Push the NDB error message as warning
+ - Used to be able to use SHOW WARNINGS toget more info on what the error is
+ - Used by replication to see if the error was temporary
+ */
+ if (ndberr->status == NdbError::TemporaryError)
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_GET_TEMPORARY_ERRMSG, ER(ER_GET_TEMPORARY_ERRMSG),
+ ndberr->code, ndberr->message, "NDB");
+ else
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
+ ER_GET_ERRMSG, ER(ER_GET_ERRMSG),
+ ndberr->code, ndberr->message, "NDB");
+ }
return error;
}
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-6.2 branch (Martin.Skold:3015) Bug#35990 | Martin Skold | 7 Oct |