Skip to content

Commit 0c246d0

Browse files
committed
Bug#27307793 IDENTIFIERS AND LOWER_CASE_TABLE_NAMES=2 INCONCISTENCY
Fixup table name comparisons to accept the fact that table name is stored different in NDB on certain platforms. Reviewed-by: Arnab Ray <[email protected]> Change-Id: Ic8289842c32a6f2f5dc234ead91c639268d77105
1 parent 16c79db commit 0c246d0

File tree

5 files changed

+6
-26
lines changed

5 files changed

+6
-26
lines changed

sql/ha_ndbcluster.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10609,11 +10609,7 @@ int ha_ndbcluster::create(const char *name,
1060910609
set_dbname(name);
1061010610
set_tabname(name);
1061110611

10612-
ndb_log_verbose(1,
10613-
"Creating table, name: '%s', m_dbname: '%s', "
10614-
"m_tabname: '%s', name in DD: '%s'",
10615-
name, m_dbname, m_tabname,
10616-
ndb_dd_table_get_name(table_def).c_str());
10612+
ndb_log_info("Creating table '%s'", name);
1061710613

1061810614
Ndb_schema_dist_client schema_dist_client(thd);
1061910615

sql/ndb_dd_client.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -681,14 +681,9 @@ Ndb_dd_client::install_table(const char* schema_name, const char* table_name,
681681
return false;
682682
}
683683

684-
// Disable this check waiting for
685-
// Bug#27307793 IDENTIFIERS AND LOWER_CASE_TABLE_NAMES=2 INCONCISTENCY
686-
if (false)
687-
{
688684
// Verify that table_name in the unpacked table definition
689685
// matches the table name to install
690-
DBUG_ASSERT(install_table->name() == table_name);
691-
}
686+
DBUG_ASSERT(ndb_dd_fs_name_case(install_table->name()) == table_name);
692687

693688
// Verify that table defintion unpacked from NDB
694689
// does not have any se_private fields set, those will be set

sql/ndb_dd_table.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,6 @@ bool ndb_dd_table_is_using_fixed_row_format(const dd::Table* table_def)
119119
return table_def->row_format() == dd::Table::RF_FIXED;
120120
}
121121

122-
dd::String_type ndb_dd_table_get_name(const dd::Table* table_def)
123-
{
124-
return table_def->name();
125-
}
126-
127122
void
128123
ndb_dd_table_set_row_format(dd::Table* table_def,
129124
const bool force_var_part)

sql/ndb_dd_table.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ namespace dd {
3737

3838
/* Functions operating on dd::Table*, prefixed with ndb_dd_table_ */
3939

40-
/*
41-
Return name of table in table definition
42-
*/
43-
dd::String_type ndb_dd_table_get_name(const dd::Table* table_def);
44-
4540
/*
4641
Save the tables object id and version in table definition
4742
*/

sql/ndb_metadata.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -35,6 +35,7 @@
3535
#include "sql/dd/impl/properties_impl.h"
3636
#include "sql/dd/types/partition.h"
3737
#include "sql/dd/types/table.h"
38+
#include "sql/ndb_dd.h"
3839
#include "sql/ndb_dd_client.h"
3940
#include "sql/ndb_dd_table.h"
4041
#include "sql/ndb_ndbapi_util.h"
@@ -297,10 +298,8 @@ bool Ndb_metadata::compare_table_def(const dd::Table* t1, const dd::Table* t2)
297298

298299
// name
299300
// When using lower_case_table_names==2 the table will be
300-
// created using lowercase in NDB while still be original case in DD
301-
// this causes a slight diff here. Workaround by skip comparing the
302-
// name until BUG#27307793
303-
//ctx.compare("name", t1->name(), t2->name());
301+
// created using lowercase in NDB while still be original case in DD.
302+
ctx.compare("name", ndb_dd_fs_name_case(t1->name()).c_str(), t2->name());
304303

305304
// collation_id
306305
// ctx.compare("collation_id", t1->collation_id(), t2->collation_id());

0 commit comments

Comments
 (0)