Skip to content

DRAFT - GTT created with the InnoDB incorrectly accept FULLTEXT/VECTOR indexes#5318

Open
pranavktiwari wants to merge 3 commits into
bb-main-global-tmpfrom
13.1-MDEV-40167
Open

DRAFT - GTT created with the InnoDB incorrectly accept FULLTEXT/VECTOR indexes#5318
pranavktiwari wants to merge 3 commits into
bb-main-global-tmpfrom
13.1-MDEV-40167

Conversation

@pranavktiwari

Copy link
Copy Markdown
Contributor

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates ha_innodb.cc to block FULLTEXT indexes on global temporary tables by checking is_global_temp. However, the review feedback points out that the implementation is incomplete, as it does not block VECTOR indexes on global temporary tables, which was also part of the pull request's objective.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread storage/innobase/handler/ha_innodb.cc

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens CREATE TABLE validation to treat GLOBAL TEMPORARY tables like TEMPORARY tables for certain InnoDB restrictions, addressing cases where InnoDB could incorrectly accept unsupported index/option combinations.

Changes:

  • Disallow DATA DIRECTORY and file-per-table-dependent options for GLOBAL TEMPORARY tables in InnoDB create option validation.
  • Reject FULLTEXT indexes on GLOBAL TEMPORARY tables in InnoDB table-flag derivation.
  • Reject VECTOR indexes on GLOBAL TEMPORARY tables during create-table finalization.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
storage/innobase/handler/ha_innodb.cc Extends InnoDB create-option and FULLTEXT validation to include GLOBAL TEMPORARY tables.
sql/sql_table.cc Extends VECTOR-index temporary-table restriction to also cover GLOBAL TEMPORARY tables.
Comments suppressed due to low confidence (1)

sql/sql_table.cc:3786

  • This change extends the VECTOR-index temporary-table restriction to GLOBAL TEMPORARY tables, but there doesn’t appear to be mysql-test coverage for the GLOBAL TEMPORARY case (e.g., existing mysql-test/main/vector.test only covers CREATE TEMPORARY TABLE). Adding a regression test for CREATE GLOBAL TEMPORARY TABLE ... VECTOR INDEX ... would help prevent future regressions.
        if (create_info->tmp_table() || create_info->global_tmp_table())
        {
          my_error(ER_NO_INDEX_ON_TEMPORARY, MYF(0), "VECTOR",
                   file->table_type());
          DBUG_RETURN(TRUE);
        }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 11058 to +11062
/* Do not use DATA DIRECTORY with TEMPORARY TABLE. */
if (m_create_info->tmp_table()) {
push_warning(
m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
"InnoDB: DATA DIRECTORY cannot be used"
" for TEMPORARY tables.");
if (m_create_info->tmp_table() || m_create_info->global_tmp_table()) {
push_warning(
m_thd, Sql_condition::WARN_LEVEL_WARN,
ER_ILLEGAL_HA_CREATE_OPTION,
Comment on lines 11514 to 11516
const bool is_temp = m_create_info->tmp_table();
const bool is_global_temp = m_create_info->global_tmp_table();
bool zip_allowed = !is_temp;
Comment on lines +11932 to +11936
/* Ignore the current innodb-file-per-table setting if we are
creating a temporary table (session or glo`bal). */
m_use_file_per_table = m_allow_file_per_table
&& !m_create_info->tmp_table()
&& !m_create_info->global_tmp_table();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants