|
1 | 1 | /*
|
2 |
| - Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. |
| 2 | + Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. |
3 | 3 |
|
4 | 4 | This program is free software; you can redistribute it and/or modify
|
5 | 5 | it under the terms of the GNU General Public License as published by
|
@@ -4246,6 +4246,25 @@ has_write_table_auto_increment_not_first_in_pk(TABLE_LIST *tables)
|
4246 | 4246 | return 0;
|
4247 | 4247 | }
|
4248 | 4248 |
|
| 4249 | +#ifndef DBUG_OFF |
| 4250 | +const char * get_locked_tables_mode_name(enum_locked_tables_mode locked_tables_mode) |
| 4251 | +{ |
| 4252 | + switch (locked_tables_mode) |
| 4253 | + { |
| 4254 | + case LTM_NONE: |
| 4255 | + return "LTM_NONE"; |
| 4256 | + case LTM_LOCK_TABLES: |
| 4257 | + return "LTM_LOCK_TABLES"; |
| 4258 | + case LTM_PRELOCKED: |
| 4259 | + return "LTM_PRELOCKED"; |
| 4260 | + case LTM_PRELOCKED_UNDER_LOCK_TABLES: |
| 4261 | + return "LTM_PRELOCKED_UNDER_LOCK_TABLES"; |
| 4262 | + default: |
| 4263 | + return "Unknown table lock mode"; |
| 4264 | + } |
| 4265 | +} |
| 4266 | +#endif |
| 4267 | + |
4249 | 4268 | /**
|
4250 | 4269 | Decide on logging format to use for the statement and issue errors
|
4251 | 4270 | or warnings as needed. The decision depends on the following
|
@@ -4397,15 +4416,8 @@ int THD::decide_logging_format(TABLE_LIST *tables)
|
4397 | 4416 | TABLE* prev_access_table= NULL;
|
4398 | 4417 |
|
4399 | 4418 | #ifndef DBUG_OFF
|
4400 |
| - { |
4401 |
| - static const char *prelocked_mode_name[] = { |
4402 |
| - "NON_PRELOCKED", |
4403 |
| - "PRELOCKED", |
4404 |
| - "PRELOCKED_UNDER_LOCK_TABLES", |
4405 |
| - }; |
4406 |
| - DBUG_PRINT("debug", ("prelocked_mode: %s", |
4407 |
| - prelocked_mode_name[locked_tables_mode])); |
4408 |
| - } |
| 4419 | + DBUG_PRINT("debug", ("prelocked_mode: %s", |
| 4420 | + get_locked_tables_mode_name(locked_tables_mode))); |
4409 | 4421 | #endif
|
4410 | 4422 |
|
4411 | 4423 | if (variables.binlog_format != BINLOG_FORMAT_ROW && tables)
|
|
0 commit comments