mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
BUG#6662: Changes after Guilhems and Sergs review
This commit is contained in:
parent
be28ef0a20
commit
1d3c67000b
6 changed files with 28 additions and 9 deletions
|
@ -489,11 +489,10 @@ static void write_header(FILE *sql_file, char *db_name)
|
|||
");
|
||||
}
|
||||
fprintf(sql_file,
|
||||
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n",
|
||||
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n"
|
||||
"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n",
|
||||
path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",",
|
||||
compatible_mode_normal_str);
|
||||
fprintf(sql_file,
|
||||
"/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n");
|
||||
check_io(sql_file);
|
||||
}
|
||||
} /* write_header */
|
||||
|
@ -521,7 +520,7 @@ static void write_footer(FILE *sql_file)
|
|||
"/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n"
|
||||
"/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
|
||||
fprintf(sql_file,
|
||||
"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;");
|
||||
"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
|
||||
fputs("\n", sql_file);
|
||||
check_io(sql_file);
|
||||
}
|
||||
|
|
|
@ -82,6 +82,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
|
@ -97,6 +98,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456)
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a int, b text, c varchar(3));
|
||||
INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
|
||||
|
@ -173,6 +175,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES (1), (2);
|
||||
|
@ -196,6 +199,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
|
@ -216,6 +220,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
create table ```a` (i int);
|
||||
CREATE TABLE ```a` (
|
||||
|
@ -250,6 +255,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
|
||||
|
@ -269,6 +275,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
set global sql_mode='ANSI_QUOTES';
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
|
@ -297,6 +304,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
|
||||
|
@ -316,6 +324,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
set global sql_mode='';
|
||||
drop table t1;
|
||||
create table t1(a int);
|
||||
|
@ -338,6 +347,7 @@ CREATE TABLE `t1` (
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
1
|
||||
2
|
||||
3
|
||||
|
@ -363,6 +373,7 @@ USE `test`;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
create database mysqldump_test_db character set latin2 collate latin2_bin;
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
|
@ -385,6 +396,7 @@ USE `mysqldump_test_db`;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop database mysqldump_test_db;
|
||||
CREATE TABLE t1 (a CHAR(10));
|
||||
INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
|
||||
|
@ -416,6 +428,7 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
|
@ -436,6 +449,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
|
@ -456,6 +470,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
|
@ -476,6 +491,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
|
||||
|
@ -496,6 +512,7 @@ UNLOCK TABLES;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int);
|
||||
CREATE TABLE t2 (a int);
|
||||
|
@ -529,5 +546,6 @@ UNLOCK TABLES;
|
|||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
|
|
@ -213,8 +213,8 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
|
|||
#define SELECT_NO_UNLOCK (1L << 28)
|
||||
|
||||
/* If set to 0, then the thread will ignore all warnings with level notes.
|
||||
Set by executing SET SHOW_NOTES=1 */
|
||||
#define OPTION_NOTES (1L << 31)
|
||||
Set by executing SET SQL_NOTES=1 */
|
||||
#define OPTION_SQL_NOTES (1L << 31)
|
||||
|
||||
/* Bits for different SQL modes modes (including ANSI mode) */
|
||||
#define MODE_REAL_AS_FLOAT 1
|
||||
|
|
|
@ -5623,7 +5623,7 @@ static void mysql_init_variables(void)
|
|||
mysql_data_home= mysql_real_data_home;
|
||||
thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL |
|
||||
OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE |
|
||||
OPTION_NOTES);
|
||||
OPTION_SQL_NOTES);
|
||||
protocol_version= PROTOCOL_VERSION;
|
||||
what_to_log= ~ (1L << (uint) COM_TIME);
|
||||
refresh_version= flush_version= 1L; /* Increments on each reload */
|
||||
|
|
|
@ -425,7 +425,7 @@ static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0,
|
|||
OPTION_WARNINGS);
|
||||
static sys_var_thd_bit sys_sql_notes("sql_notes", 0,
|
||||
set_option_bit,
|
||||
OPTION_NOTES);
|
||||
OPTION_SQL_NOTES);
|
||||
static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0,
|
||||
set_option_bit,
|
||||
OPTION_AUTO_IS_NULL);
|
||||
|
@ -863,6 +863,8 @@ struct show_var_st init_vars[]= {
|
|||
{sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS},
|
||||
{sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS},
|
||||
{sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS},
|
||||
{"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL},
|
||||
{"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL},
|
||||
#ifdef HAVE_REPLICATION
|
||||
{sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS},
|
||||
{sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS},
|
||||
|
|
|
@ -105,7 +105,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level,
|
|||
MYSQL_ERROR *err= 0;
|
||||
DBUG_ENTER("push_warning");
|
||||
|
||||
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_NOTES))
|
||||
if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES))
|
||||
return(0);
|
||||
|
||||
if (thd->query_id != thd->warn_id)
|
||||
|
|
Loading…
Reference in a new issue