Details
Description
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_base.cc: In function ‘my_bool mysql_rm_tmp_tables()’:
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_base.cc:9435:30: warning: array subscript 0 is outside array bounds of ‘handlerton [0]’ [-Warray-bounds]
|
9435 | share.db_type()->drop_table(share.db_type(), path_copy);
|
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~
|
...
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc: In function ‘bool handle_list_of_fields(THD*, List_iterator<const char>, TABLE*, partition_info*, bool)’:
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc:720:32: warning: array subscript 0 is outside array bounds of ‘handlerton [0]’ [-Warray-bounds]
|
720 | if (table->s->db_type()->partition_flags &&
|
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
|
In file included from /home/buildbot/buildbot/build/mariadb-11.4.5/sql/mariadb.h:29,
|
from /home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc:50:
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc: In function ‘bool fix_partition_func(THD*, TABLE*, bool)’:
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc:2056:40: warning: array subscript 0 is outside array bounds of ‘handlerton [0]’ [-Warray-bounds]
|
2056 | if (unlikely((!(table->s->db_type()->partition_flags &&
|
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
|
/home/buildbot/buildbot/build/mariadb-11.4.5/include/my_global.h:365:44: note: in definition of macro ‘unlikely’
|
365 | #define unlikely(x) __builtin_expect(((x) != 0),0)
|
| ^
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc: In function ‘bool partition_key_modified(TABLE*, const MY_BITMAP*)’:
|
/home/buildbot/buildbot/build/mariadb-11.4.5/sql/sql_partition.cc:2786:28: warning: array subscript 0 is outside array bounds of ‘handlerton [0]’ [-Warray-bounds]
|
2786 | if (table->s->db_type()->partition_flags &&
|
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
|
Locally it requires at least -O3 in CMAKE_CXX_FLAGS to reproduce.
Triggered even if we replace plugin_hton(db_plugin) with
(handlerton *)((*db_plugin)->data) in db_type(). Therefore it
looks like a false positive (or
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104828) to me.
I was wondering whether -O3 causes Warray-bounds=2, but the warning
also appears with -O3 -Warray-bounds=1.
gcc versions:
Mine:
$ g++ --version
g++ (Debian 13.2.0-13) 13.2.0
In the buildbot stdout:
g++ (Debian 12.2.0-14) 12.2.0
Hi danblack, ptal thanks:
0432a765de0 upstream/bb-10.5-mdev-35840 MDEV-35840 Eliminate -warray-bounds triggered by TABLE_SHARE::db_type()
Old buildbot pages:
https://buildbot.mariadb.net/buildbot/changes/808821
https://buildbot.mariadb.net/buildbot/changes/808823