File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -730,6 +730,21 @@ bool LOGGER::is_log_table_enabled(uint log_table_type)
730
730
}
731
731
}
732
732
733
+
734
+ int check_if_log_table (const TABLE_LIST *table)
735
+ {
736
+ if (MYSQL_SCHEMA_NAME.streq (table->db ))
737
+ {
738
+ if (GENERAL_LOG_NAME.streq (table->table_name ))
739
+ return QUERY_LOG_GENERAL;;
740
+
741
+ if (SLOW_LOG_NAME.streq (table->table_name ))
742
+ return QUERY_LOG_SLOW;
743
+ }
744
+ return 0 ;
745
+ }
746
+
747
+
733
748
/* *
734
749
Check if a given table is opened log table
735
750
@@ -745,25 +760,9 @@ int check_if_log_table(const TABLE_LIST *table,
745
760
bool check_if_opened,
746
761
const char *error_msg)
747
762
{
748
- int result= 0 ;
749
- if (MYSQL_SCHEMA_NAME.streq (table->db ))
750
- {
751
- if (GENERAL_LOG_NAME.streq (table->table_name ))
752
- {
753
- result= QUERY_LOG_GENERAL;
754
- goto end;
755
- }
756
-
757
- if (SLOW_LOG_NAME.streq (table->table_name ))
758
- {
759
- result= QUERY_LOG_SLOW;
760
- goto end;
761
- }
762
- }
763
- return 0 ;
764
-
765
- end:
766
- if (!check_if_opened || logger.is_log_table_enabled (result))
763
+ int result= check_if_log_table (table);
764
+ if (result &&
765
+ (!check_if_opened || logger.is_log_table_enabled (result)))
767
766
{
768
767
if (error_msg)
769
768
my_error (ER_BAD_LOG_STATEMENT, MYF (0 ), error_msg);
Original file line number Diff line number Diff line change @@ -1013,6 +1013,7 @@ class Log_event_handler
1013
1013
};
1014
1014
1015
1015
1016
+ int check_if_log_table (const TABLE_LIST *table);
1016
1017
int check_if_log_table (const TABLE_LIST *table, bool check_if_opened,
1017
1018
const char *errmsg);
1018
1019
You can’t perform that action at this time.
0 commit comments