Skip to content
/ server Public

MDEV-36444: Add CREATE_OPTIONS column to I_S.COLUMNS and I_S.STATISTICS#4618

Open
abhishek593 wants to merge 5 commits intoMariaDB:mainfrom
abhishek593:MDEV-36444
Open

MDEV-36444: Add CREATE_OPTIONS column to I_S.COLUMNS and I_S.STATISTICS#4618
abhishek593 wants to merge 5 commits intoMariaDB:mainfrom
abhishek593:MDEV-36444

Conversation

@abhishek593
Copy link

This change exposes engine-defined column and index options in the I_S.COLUMNS and I_S.STATISTICS tables, respectively.

Key changes:

  • Extended I_S schema with CREATE_OPTIONS in sql/sql_show.cc.
  • Added explicit verification cases to table_options-5867.test and modified existing test results.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Feb 5, 2026
Copy link
Member

@vuvova vuvova left a comment

Choose a reason for hiding this comment

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

see comments inline. And please rebase on top of the main branch

sql/sql_show.cc Outdated
Comment on lines 6653 to 6655
char option_buff[512];
String str(option_buff, sizeof(option_buff), system_charset_info);
str.length(0);
Copy link
Member

Choose a reason for hiding this comment

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

use StringBuffer<> instead

Copy link
Author

Choose a reason for hiding this comment

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

Done

sql/sql_show.cc Outdated
table->field[24]->set_notnull();
}
else
table->field[24]->set_null();
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about it. NULL generally means that there can be no create options, that it the concept is not applicable here. But it is not the case, the list is simply empty, I'd expect an empty string here, not NULL

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, makes sense. I have updated the implementation to store an empty string.

append_create_options(thd, &str, field->option_list, false, 0);
if (str.length())
{
table->field[24]->store(str.ptr() + 1, str.length() - 1, cs);
Copy link
Member

Choose a reason for hiding this comment

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

add a comment, why + 1

Copy link
Author

Choose a reason for hiding this comment

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

Added.

}
else
table->field[17]->set_null();
}
Copy link
Member

Choose a reason for hiding this comment

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

same comments as above

Copy link
Author

Choose a reason for hiding this comment

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

Done

sql/sql_show.cc Outdated
NULLABLE, OPEN_FRM_ONLY), // 21
Column("IS_SYSTEM_TIME_PERIOD_START", Varchar(3), NOT_NULL, OPEN_FRM_ONLY), // 22
Column("IS_SYSTEM_TIME_PERIOD_END", Varchar(3), NOT_NULL, OPEN_FRM_ONLY), // 23
Column("CREATE_OPTIONS", Varchar(2048), NULLABLE, OPEN_FRM_ONLY), // 24
Copy link
Member

Choose a reason for hiding this comment

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

not nullable (same below)

Copy link
Author

Choose a reason for hiding this comment

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

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

3 participants