Skip to content
This repository was archived by the owner on Mar 27, 2021. It is now read-only.

Commit 2cc70a0

Browse files
committed
v2.1.52.2,TEXT/BLOB字段定义为NOT NULL时给出提示
1 parent 7e12da5 commit 2cc70a0

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Diff for: cmake/mysql_version.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ MACRO(GET_MYSQL_VERSION)
5353
MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.")
5454
ENDIF()
5555

56-
SET(VERSION "2.1.52.1")
56+
SET(VERSION "2.1.52.2")
5757
MESSAGE(STATUS "MySQL ${VERSION}")
5858
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
5959
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")

Diff for: sql/derror.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ bool init_errmessage(void)
182182
SERVER_SETMSG(ER_INDEX_USE_ALTER_TABLE, "请使用ALTER语句进行索引变更");
183183
SERVER_SETMSG(ER_WITH_DEFAULT_ADD_COLUMN, "建议给字段 \'%-.192s\' 添加默认值");
184184
SERVER_SETMSG(ER_TRUNCATED_WRONG_VALUE, "Truncated incorrect %-.32s value: \'%-.128s\'");
185-
SERVER_SETMSG(ER_TEXT_NOT_NULLABLE_ERROR, "TEXT/BLOB字段 \'%-.64s\' 不允许为NULL,请指定为NOT NULL");
185+
SERVER_SETMSG(ER_TEXT_NOT_NULLABLE_ERROR, "TEXT/BLOB字段 \'%-.64s\' 无法设置默认值,不建议使用NOT NULL,请指定为NULL");
186186
SERVER_SETMSG(ER_WRONG_VALUE_FOR_VAR, "Variable \'%-.64s\' can\'t be set to the value of \'%-.200s\'");
187187
SERVER_SETMSG(ER_TOO_MUCH_AUTO_TIMESTAMP_COLS, "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause");
188188
SERVER_SETMSG(ER_INVALID_ON_UPDATE, "Invalid ON UPDATE clause for \'%-.192s\' column");

Diff for: sql/sql_parse.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -2017,7 +2017,6 @@ mysql_check_inception_variables(
20172017
return false;
20182018
break;
20192019

2020-
case ER_TEXT_NOT_NULLABLE_ERROR:
20212020
case ER_NOT_ALLOWED_NULLABLE:
20222021
if (inception_enable_nullable)
20232022
return false;
@@ -5335,7 +5334,7 @@ int mysql_field_check(THD* thd, Create_field* field, char* table_name)
53355334
mysql_errmsg_append(thd);
53365335
}
53375336

5338-
if (!(field->flags & NOT_NULL_FLAG) && mysql_field_is_blob(field->sql_type))
5337+
if ((field->flags & NOT_NULL_FLAG) && mysql_field_is_blob(field->sql_type))
53395338
{
53405339
my_error(ER_TEXT_NOT_NULLABLE_ERROR, MYF(0), field->field_name, table_name);
53415340
mysql_errmsg_append(thd);

0 commit comments

Comments
 (0)