From a16df9bb6082adb0341470f38fc5af1dee4215f8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 12 Jun 2026 14:12:29 +0200 Subject: [PATCH] cleanup: remove redundant function --- sql/sql_base.cc | 5 ----- sql/sql_base.h | 3 +-- sql/sql_trigger.cc | 6 +++--- sql/sql_view.cc | 6 +++--- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 08ffef97bf2..0ba0444f595 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -9860,11 +9860,6 @@ int init_ftfuncs(THD *thd, SELECT_LEX *select_lex, bool no_order) } -bool is_equal(const LEX_CSTRING *a, const LEX_CSTRING *b) -{ - return a->length == b->length && !strncmp(a->str, b->str, a->length); -} - /* Open and lock system tables for read. diff --git a/sql/sql_base.h b/sql/sql_base.h index 031e6152663..89df29ceae2 100644 --- a/sql/sql_base.h +++ b/sql/sql_base.h @@ -1,5 +1,5 @@ /* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. - Copyright (c) 2011, 2018, MariaDB + Copyright (c) 2011, 2026, MariaDB plc. This program is free software; you can redistribute it and/or modify @@ -307,7 +307,6 @@ TABLE_LIST* unique_table_in_insert_returning_subselect(THD *thd, TABLE_LIST *table, SELECT_LEX *sel); TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list, uint check_flag); -bool is_equal(const LEX_CSTRING *a, const LEX_CSTRING *b); class Open_tables_backup; /* Functions to work with system tables. */ diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index e860a4886c6..b0cf016c7df 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2004, 2012, Oracle and/or its affiliates. - Copyright (c) 2010, 2022, MariaDB + Copyright (c) 2010, 2026, MariaDB plc. 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 @@ -1741,7 +1741,7 @@ bool Table_triggers_list::check_n_load(THD *thd, const LEX_CSTRING *db, if ((parser= sql_parse_prepare(&path, &table->mem_root, 1))) { - if (is_equal(&triggers_file_type, parser->type())) + if (lex_string_eq(&triggers_file_type, parser->type())) { Handle_old_incorrect_sql_modes_hook sql_modes_hook(path.str); LEX_CSTRING *trg_create_str, *trg_sql_path; @@ -3223,7 +3223,7 @@ bool load_table_name_for_trigger(THD *thd, if (!(parser= sql_parse_prepare(trn_path, thd->mem_root, TRUE))) DBUG_RETURN(TRUE); - if (!is_equal(&trigname_file_type, parser->type())) + if (!lex_string_eq(&trigname_file_type, parser->type())) { my_error(ER_WRONG_OBJECT, MYF(0), trg_name->m_name.str, diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 89d63914aa7..dd6b7cdc967 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2004, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2021, MariaDB Corporation. + Copyright (c) 2011, 2026, MariaDB plc. 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 @@ -1174,7 +1174,7 @@ loop_out: goto err; } - if (!parser->ok() || !is_equal(&view_type, parser->type())) + if (!parser->ok() || !lex_string_eq(&view_type, parser->type())) { my_error(ER_WRONG_OBJECT, MYF(0), view->db.str, view->table_name.str, "VIEW"); @@ -2364,7 +2364,7 @@ mysql_rename_view(THD *thd, reg_ext, 0); if ((parser= sql_parse_prepare(&pathstr, thd->mem_root, 1)) && - is_equal(&view_type, parser->type())) + lex_string_eq(&view_type, parser->type())) { TABLE_LIST view_def; char dir_buff[FN_REFLEN + 1];