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

Commit

Permalink
v2.1.52.2,TEXT/BLOB字段定义为NOT NULL时给出提示
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyo committed Apr 25, 2019
1 parent 7e12da5 commit 2cc70a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake/mysql_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MACRO(GET_MYSQL_VERSION)
MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.")
ENDIF()

SET(VERSION "2.1.52.1")
SET(VERSION "2.1.52.2")
MESSAGE(STATUS "MySQL ${VERSION}")
SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version")
SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion sql/derror.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ bool init_errmessage(void)
SERVER_SETMSG(ER_INDEX_USE_ALTER_TABLE, "请使用ALTER语句进行索引变更");
SERVER_SETMSG(ER_WITH_DEFAULT_ADD_COLUMN, "建议给字段 \'%-.192s\' 添加默认值");
SERVER_SETMSG(ER_TRUNCATED_WRONG_VALUE, "Truncated incorrect %-.32s value: \'%-.128s\'");
SERVER_SETMSG(ER_TEXT_NOT_NULLABLE_ERROR, "TEXT/BLOB字段 \'%-.64s\' 不允许为NULL,请指定为NOT NULL");
SERVER_SETMSG(ER_TEXT_NOT_NULLABLE_ERROR, "TEXT/BLOB字段 \'%-.64s\' 无法设置默认值,不建议使用NOT NULL,请指定为NULL");
SERVER_SETMSG(ER_WRONG_VALUE_FOR_VAR, "Variable \'%-.64s\' can\'t be set to the value of \'%-.200s\'");
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");
SERVER_SETMSG(ER_INVALID_ON_UPDATE, "Invalid ON UPDATE clause for \'%-.192s\' column");
Expand Down
3 changes: 1 addition & 2 deletions sql/sql_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,6 @@ mysql_check_inception_variables(
return false;
break;

case ER_TEXT_NOT_NULLABLE_ERROR:
case ER_NOT_ALLOWED_NULLABLE:
if (inception_enable_nullable)
return false;
Expand Down Expand Up @@ -5335,7 +5334,7 @@ int mysql_field_check(THD* thd, Create_field* field, char* table_name)
mysql_errmsg_append(thd);
}

if (!(field->flags & NOT_NULL_FLAG) && mysql_field_is_blob(field->sql_type))
if ((field->flags & NOT_NULL_FLAG) && mysql_field_is_blob(field->sql_type))
{
my_error(ER_TEXT_NOT_NULLABLE_ERROR, MYF(0), field->field_name, table_name);
mysql_errmsg_append(thd);
Expand Down

0 comments on commit 2cc70a0

Please sign in to comment.