Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS-4727 - intrinsic temp table behaviour shouldn't depend on innodb_e… #2481

Merged
merged 1 commit into from
Aug 13, 2018

Conversation

satya-bodapati
Copy link
Contributor

@satya-bodapati satya-bodapati commented Aug 10, 2018

…ncrypt_tables

Problem:

Optimizer temporary tables (aka Intrinsic temp table) encryption attribute is based on innodb_encrypt_tables. So when innodb_encrypt_tables is ON and innodb_temp_tablespace_encrypt is OFF, queries that use disk temp storage engine will fail. For example statements that use GROUP BY, ORDER BY INSERT SELECT, etc will fail.

Fix:

Intrinsic temp tables should derive encryption attribute from
temporary tablespace property and not rely on innodb_encrypt_tables

@satya-bodapati
Copy link
Contributor Author

@satya-bodapati
Copy link
Contributor Author

https://jenkins.percona.com/view/5.7/job/mysql-5.7-param/1896/ is finished. Only unrelated tests(tokudb & rocksdb) tests failing

Copy link
Contributor

@laurynas-biveinis laurynas-biveinis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment, up to you to address or not. If you do, it will be sufficient to test only that testcase

SET big_tables=ON;
INSERT INTO t1 SELECT * FROM t1;
DROP TABLE t1;
SET big_tables=default;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of manipulating big_tables, a shorter version would be SELECT SQL_BIG_RESULT ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From documentation, "SQL_BIG_RESULT or SQL_SMALL_RESULT can be used with GROUP BY or DISTINCT to tell the optimizer that the result set has many rows or is small, respectively.'
Since I am using INSERT SELECT (although it may work), I would prefer SET big_tables here.

BTW, this is added as safety measure. With BLOBs, innodb storage engine is used in 5.7. In future (with temptable engine in 8.0 etc), this may not be true. So I added this protection

…ncrypt_tables

Problem:
--------
Optimizer temporary tables (aka Intrinsic temp table) encryption attribute
is based on innodb_encrypt_tables. So when innodb_encrypt_tables is ON and
innodb_temp_tablespace_encrypt is OFF, queries that use disk temp storage
engine will fail. For example statements that use GROUP BY, ORDER BY,
INSERT SELECT, etc will fail.

Fix:
----
Intrinsic temp tables should derive encryption attribute from
temporary tablespace property and not rely on innodb_encrypt_tables
@satya-bodapati satya-bodapati merged commit e0dd2f8 into percona:5.7 Aug 13, 2018
@satya-bodapati satya-bodapati deleted the PS-5.7-4727 branch September 3, 2018 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants