Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tianmu): provide error information for "create constraint and foreign keys"(not supported) #1838

Open
wants to merge 2 commits into
base: stonedb-8.0-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions share/messages_to_clients.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9809,6 +9809,9 @@ ER_CREATE_SELECT_WITH_GIPK_DISALLOWED_IN_SBR
ER_DA_EXPIRE_LOGS_DAYS_IGNORED
eng "The option expire_logs_days cannot be used together with option binlog_expire_logs_seconds. To set one, first unset the other by setting it to 0."

ER_TIANMU_NOT_SUPPORTED_FOREIGN_KEY
eng "Tianmu engine dose not support foreign key."

#
# End of 8.0 error messages (server-to-client).
# Do NOT add messages intended for the error log above!
Expand Down
5 changes: 4 additions & 1 deletion sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6552,7 +6552,10 @@ static bool prepare_foreign_key(THD *thd, HA_CREATE_INFO *create_info,
// the FK has been made, it is enough to check it for new FKs.
if (fk_key->validate(thd, table_name, alter_info->create_list)) return true;

if (!se_supports_fks) return false;
if (!se_supports_fks) {
my_error(ER_TIANMU_NOT_SUPPORTED_FOREIGN_KEY, MYF(0));
return true;
}

if (fk_key->has_explicit_name) {
assert(fk_key->name.str);
Expand Down
Loading