Skip to content

Commit d4b1ddc

Browse files
committed
Bug#29955295 NDBCLUSTER FUNCTION PARAMETER SHADOWS HANDLER::TABLE
Compiler warning showing that the parameter "table" of functions ha_ndbcluster::unpack_record_and_set_generated_fields() and ha_ndbcluster::get_partition_row_type() hides the handler::table member. /home/mblaudd/mysql/trunk/sql/ha_ndbcluster.cc:7094:10: warning: parameter 'table' shadows member inherited from type 'handler' [-Wshadow-field] TABLE *table, ^ /home/mblaudd/mysql/trunk/sql/handler.h:3990:10: note: declared here TABLE *table; /* The current open table */ ^ /home/mblaudd/mysql/trunk/sql/ha_ndbcluster.cc:16609:22: warning: parameter 'table' shadows member inherited from type 'handler' [-Wshadow-field] const dd::Table *table MY_ATTRIBUTE((unused)), ^ /home/mblaudd/mysql/trunk/sql/handler.h:3990:10: note: declared here TABLE *table; /* The current open table */ ^ Fix ha_ndbcluster::unpack_record_and_set_generated_fields() by removing parameter and use handler::table directly. Fix ha_ndbcluster::get_partition_row_type() by renaming the dd::Table parameter to "table_def" like in other functions taking a dd::Table. Also fix same problem in ha_ndbcluster::get_fk_data_for_truncate() by renameing parameter to "ndbtab". Change-Id: I623e967da6f6ca9e623667db0c30ec9790eb3a87
1 parent d4dfbbd commit d4b1ddc

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

sql/ha_ndb_ddl_fk.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,13 +2599,14 @@ ha_ndbcluster::inplace__drop_fks(THD * thd, Ndb* ndb, NDBDICT * dict,
25992599
*/
26002600

26012601
int
2602-
ha_ndbcluster::get_fk_data_for_truncate(NDBDICT* dict, const NDBTAB* table,
2602+
ha_ndbcluster::get_fk_data_for_truncate(NdbDictionary::Dictionary* dict,
2603+
const NdbDictionary::Table* ndbtab,
26032604
Ndb_fk_list& fk_list)
26042605
{
26052606
DBUG_ENTER("ha_ndbcluster::get_fk_data_for_truncate");
26062607

26072608
NDBDICT::List obj_list;
2608-
if (dict->listDependentObjects(obj_list, *table) != 0)
2609+
if (dict->listDependentObjects(obj_list, *ndbtab) != 0)
26092610
{
26102611
ERR_RETURN(dict->getNdbError());
26112612
}

sql/ha_ndbcluster.cc

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,7 +3715,7 @@ int ha_ndbcluster::fetch_next_pushed()
37153715
{
37163716
DBUG_ASSERT(m_next_row!=NULL);
37173717
DBUG_PRINT("info", ("One more record found"));
3718-
const int ignore = unpack_record_and_set_generated_fields(table, table->record[0],
3718+
const int ignore = unpack_record_and_set_generated_fields(table->record[0],
37193719
m_next_row);
37203720
// m_thd_ndb->m_pushed_reads++;
37213721
if (likely(!ignore))
@@ -3766,7 +3766,7 @@ ha_ndbcluster::index_read_pushed(uchar *buf, const uchar *key,
37663766
if (result == NdbQuery::NextResult_gotRow)
37673767
{
37683768
DBUG_ASSERT(m_next_row!=NULL);
3769-
const int ignore = unpack_record_and_set_generated_fields(table, buf, m_next_row);
3769+
const int ignore = unpack_record_and_set_generated_fields(buf, m_next_row);
37703770
m_thd_ndb->m_pushed_reads++;
37713771
if (unlikely(ignore))
37723772
{
@@ -7091,7 +7091,6 @@ int ha_ndbcluster::unpack_record(uchar *dst_row, const uchar *src_row)
70917091
}
70927092

70937093
int ha_ndbcluster::unpack_record_and_set_generated_fields(
7094-
TABLE *table,
70957094
uchar *dst_row,
70967095
const uchar *src_row)
70977096
{
@@ -15956,7 +15955,7 @@ int ha_ndbcluster::multi_range_read_next(char **range_info)
1595615955
current_range_no);
1595715956
/* Copy out data from the new row. */
1595815957
const int ignore =
15959-
unpack_record_and_set_generated_fields(table, table->record[0],
15958+
unpack_record_and_set_generated_fields(table->record[0],
1596015959
m_next_row);
1596115960
/*
1596215961
Mark that we have used this row, so we need to fetch a new
@@ -16601,13 +16600,7 @@ static MYSQL_SYSVAR_ENUM(
1660116600
&distribution_typelib /* typelib */
1660216601
);
1660316602

16604-
/* Get partition row type
16605-
@param[in] table partition_table
16606-
@param[in] part_id Id of partition for which row type to be retrieved
16607-
@return Partition row type. */
16608-
enum row_type ha_ndbcluster::get_partition_row_type(
16609-
const dd::Table *table MY_ATTRIBUTE((unused)),
16610-
uint part_id MY_ATTRIBUTE((unused))) {
16603+
enum row_type ha_ndbcluster::get_partition_row_type(const dd::Table*, uint) {
1661116604
return table_share->real_row_type;
1661216605
}
1661316606

sql/ha_ndbcluster.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class ha_ndbcluster: public handler, public Partition_handler
211211
@param[in] table partition table
212212
@param[in] part_id Id of partition for which row type to be retrieved
213213
@return Partition row type. */
214-
enum row_type get_partition_row_type(const dd::Table *table,
214+
enum row_type get_partition_row_type(const dd::Table *table_def,
215215
uint part_id) override;
216216

217217
private:
@@ -570,7 +570,7 @@ class ha_ndbcluster: public handler, public Partition_handler
570570
int next_result(uchar *buf);
571571
int close_scan();
572572
int unpack_record(uchar *dst_row, const uchar *src_row);
573-
int unpack_record_and_set_generated_fields(TABLE *, uchar *dst_row,
573+
int unpack_record_and_set_generated_fields(uchar *dst_row,
574574
const uchar *src_row);
575575
void set_dbname(const char *pathname);
576576
void set_tabname(const char *pathname);

0 commit comments

Comments
 (0)