Bug #80105 Accessing INNODB_BUFFER_PAGE when InnoDB is not active crashes
Submitted: 21 Jan 2016 23:30 Modified: 22 Feb 2016 10:07
Reporter: Jay Edgar Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:5.6.27.75 OS:CentOS (6.7)
Assigned to: CPU Architecture:Any

[21 Jan 2016 23:30] Jay Edgar
Description:
When InnoDB is not active (--skip-innodb) accessing most of the InnoDB INFORMATION_SCHEMA tables is safe, but accessing INFORMATION_SCHEMA.INNODB_BUFFER_PAGE causes a crash.

How to repeat:
Start the server with --skip-innodb
Connect and issue "SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE"

Suggested fix:
It looks like i_s_innodb_buffer_page_fill() in storage/innobase/handler/i_s.cc needs to call RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); right after the call to DBUG_ENTER().

Also other functions may need this same change.  Others that look wrong to me are:

  - i_s_metrics_fill_table
  - i_s_stopword_fill
  - i_s_fts_deleted_fill
  - i_s_fts_being_deleted_fill
  - i_s_fts_index_cache_fill
  - i_s_fts_index_table_fill
  - i_s_fts_config_fill
  - i_s_innodb_buffer_page_fill_table

Also, as I was looking through the code I noticed that the string passed into DBUG_ENTER in i_s_fts_being_deleted_init is incorrect.  It looks like it should be the name of the current function, but a different function is being supplied.
[22 Jan 2016 10:07] MySQL Verification Team
Hello Jay,

Thank you for the report.
I'm not seeing this issue at my end with 5.6.28/5.6.27 builds after following steps from https://dev.mysql.com/doc/refman/5.6/en/innodb-turning-off.html to turn off innodb. Could you please provide exact details of your build, or any other details(conf file used etc) which would help us to trigger this issue? Thank you.

-- Tried with existing instance(when innodb enabled by default, and brought up by disabling), with innodb disabled

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: cat my.cnf |grep loose*
loose-innodb-trx=0
loose-innodb-locks=0
loose-innodb-lock-waits=0
loose-innodb-cmp=0
loose-innodb-cmp-per-index=0
loose-innodb-cmp-per-index-reset=0
loose-innodb-cmp-reset=0
loose-innodb-cmpmem=0
loose-innodb-cmpmem-reset=0
loose-innodb-buffer-page=0
loose-innodb-buffer-page-lru=0
loose-innodb-buffer-pool-stats=0
loose-innodb-metrics=0
loose-innodb-ft-default-stopword=0
loose-innodb-ft-inserted=0
loose-innodb-ft-deleted=0
loose-innodb-ft-being-deleted=0
loose-innodb-ft-config=0
loose-innodb-ft-index-cache=0
loose-innodb-ft-index-table=0
loose-innodb-sys-tables=0
loose-innodb-sys-tablestats=0
loose-innodb-sys-indexes=0
loose-innodb-sys-columns=0
loose-innodb-sys-fields=0
loose-innodb-sys-foreign=0
loose-innodb-sys-foreign-cols=0

- existing instance

scripts/mysql_install_db --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.28 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.28 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923/log.err 2>&1 &

- bring down and start with 

bin/mysqld --defaults-file=./my.cnf  --innodb=OFF --default-storage-engine=myisam --default-tmp-storage-engine=myisam --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.28 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: 2016-01-22 06:13:08 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-22 06:13:08 0 [Note] bin/mysqld (mysqld 5.6.28-enterprise-commercial-advanced) starting as process 19558 ...

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
Empty set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                     |
+---------+------+-------------------------------------------------------------------------------------------------------------+
| Warning | 1012 | InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_PAGE but the InnoDB storage engine is not installed |
+---------+------+-------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

- with fresh installation

rm -rf 79923
scripts/mysql_install_db --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.28 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923
bin/mysqld --defaults-file=./my.cnf  --innodb=OFF --default-storage-engine=myisam --default-tmp-storage-engine=myisam --basedir=/export/umesh/server/binaries/mysql-advanced-5.6.28 --datadir=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.6.28/79923/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.6.28: bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
ERROR 1109 (42S02): Unknown table 'INNODB_BUFFER_PAGE' in information_schema
mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
ERROR 1109 (42S02): Unknown table 'INNODB_BUFFER_PAGE' in information_schema

-- with 
	#loose-innodb-buffer-page=0
	#loose-innodb-buffer-page-lru=0

mysql> SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE;
Empty set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                     |
+---------+------+-------------------------------------------------------------------------------------------------------------+
| Warning | 1012 | InnoDB: SELECTing from INFORMATION_SCHEMA.INNODB_BUFFER_PAGE but the InnoDB storage engine is not installed |
+---------+------+-------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Thanks,
Umesh
[23 Feb 2016 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".