mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge 10.4 into 10.5
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/*
|
||||
Copyright (c) 2004, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2021, MariaDB
|
||||
Copyright (c) 2010, 2022, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -415,6 +415,10 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
|
||||
MDL_ticket *mdl_ticket= NULL;
|
||||
MDL_request mdl_request_for_trn;
|
||||
Query_tables_list backup;
|
||||
char path[FN_REFLEN + 1];
|
||||
char engine_name_buf[NAME_CHAR_LEN + 1];
|
||||
LEX_CSTRING engine_name= { engine_name_buf, 0 };
|
||||
|
||||
DBUG_ENTER("mysql_create_or_drop_trigger");
|
||||
|
||||
/* Charset of the buffer for statement must be system one. */
|
||||
@ -540,8 +544,12 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
|
||||
/* We should have only one table in table list. */
|
||||
DBUG_ASSERT(tables->next_global == 0);
|
||||
|
||||
/* We do not allow creation of triggers on temporary tables. */
|
||||
if (create && thd->find_tmp_table_share(tables))
|
||||
build_table_filename(path, sizeof(path) - 1, tables->db.str, tables->alias.str, ".frm", 0);
|
||||
tables->required_type= dd_frm_type(NULL, path, &engine_name);
|
||||
|
||||
/* We do not allow creation of triggers on temporary tables or sequence. */
|
||||
if (tables->required_type == TABLE_TYPE_SEQUENCE ||
|
||||
(create && thd->find_tmp_table_share(tables)))
|
||||
{
|
||||
my_error(ER_TRG_ON_VIEW_OR_TEMP_TABLE, MYF(0), tables->alias.str);
|
||||
goto end;
|
||||
|
Reference in New Issue
Block a user