You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

618 lines
18 KiB

MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
Added extra argument to longlong2str() to make it have same prototype is int2str() Changed to use longlong10_to_str() instead of longlong2str() when base is 10 or -10 as former is much faster than later Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit. client/mysqltest.cc: longlong2str() -> longlong10_to_str() include/m_string.h: Added extra argument to longlong2str() to make it have same prototype is int2str() mysys/charset.c: Fixed compiler warning mysys/mf_soundex.c: Fixed compiler warning mysys/my_getopt.c: longlong2str() -> longlong10_to_str() sql/create_options.cc: Fixed compiler warning sql/item_strfunc.cc: Added extra argument to longlong2str sql/opt_range.cc: longlong2str() -> longlong10_to_str() sql/partition_info.cc: longlong2str() -> longlong10_to_str() sql/slave.cc: longlong2str() -> longlong10_to_str() sql/sql_bitmap.h: Added extra argument to longlong2str sql/sql_partition.cc: Added extra argument to longlong2str sql/sql_select.cc: longlong2str() -> longlong10_to_str() sql/sql_show.cc: Added extra argument to longlong2str storage/innodb_plugin/handler/ha_innodb.cc: Update to new parameters for longlong2str() storage/maria/ma_dbug.c: longlong2str() -> longlong10_to_str() storage/maria/maria_chk.c: Added extra argument to longlong2str storage/myisam/mi_dbug.c: longlong2str() -> longlong10_to_str() storage/myisam/myisamchk.c: Added extra argument to longlong2str storage/xtradb/handler/ha_innodb.cc: Update to new parameters for longlong2str() strings/longlong2str.c: Added extra argument to longlong2str() to make it have same prototype is int2str() strings/my_vsnprintf.c: Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit. Added cast to get rid of compiler warnings
16 years ago
Added extra argument to longlong2str() to make it have same prototype is int2str() Changed to use longlong10_to_str() instead of longlong2str() when base is 10 or -10 as former is much faster than later Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit. client/mysqltest.cc: longlong2str() -> longlong10_to_str() include/m_string.h: Added extra argument to longlong2str() to make it have same prototype is int2str() mysys/charset.c: Fixed compiler warning mysys/mf_soundex.c: Fixed compiler warning mysys/my_getopt.c: longlong2str() -> longlong10_to_str() sql/create_options.cc: Fixed compiler warning sql/item_strfunc.cc: Added extra argument to longlong2str sql/opt_range.cc: longlong2str() -> longlong10_to_str() sql/partition_info.cc: longlong2str() -> longlong10_to_str() sql/slave.cc: longlong2str() -> longlong10_to_str() sql/sql_bitmap.h: Added extra argument to longlong2str sql/sql_partition.cc: Added extra argument to longlong2str sql/sql_select.cc: longlong2str() -> longlong10_to_str() sql/sql_show.cc: Added extra argument to longlong2str storage/innodb_plugin/handler/ha_innodb.cc: Update to new parameters for longlong2str() storage/maria/ma_dbug.c: longlong2str() -> longlong10_to_str() storage/maria/maria_chk.c: Added extra argument to longlong2str storage/myisam/mi_dbug.c: longlong2str() -> longlong10_to_str() storage/myisam/myisamchk.c: Added extra argument to longlong2str storage/xtradb/handler/ha_innodb.cc: Update to new parameters for longlong2str() strings/longlong2str.c: Added extra argument to longlong2str() to make it have same prototype is int2str() strings/my_vsnprintf.c: Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit. Added cast to get rid of compiler warnings
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
Added extra argument to longlong2str() to make it have same prototype is int2str() Changed to use longlong10_to_str() instead of longlong2str() when base is 10 or -10 as former is much faster than later Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit. client/mysqltest.cc: longlong2str() -> longlong10_to_str() include/m_string.h: Added extra argument to longlong2str() to make it have same prototype is int2str() mysys/charset.c: Fixed compiler warning mysys/mf_soundex.c: Fixed compiler warning mysys/my_getopt.c: longlong2str() -> longlong10_to_str() sql/create_options.cc: Fixed compiler warning sql/item_strfunc.cc: Added extra argument to longlong2str sql/opt_range.cc: longlong2str() -> longlong10_to_str() sql/partition_info.cc: longlong2str() -> longlong10_to_str() sql/slave.cc: longlong2str() -> longlong10_to_str() sql/sql_bitmap.h: Added extra argument to longlong2str sql/sql_partition.cc: Added extra argument to longlong2str sql/sql_select.cc: longlong2str() -> longlong10_to_str() sql/sql_show.cc: Added extra argument to longlong2str storage/innodb_plugin/handler/ha_innodb.cc: Update to new parameters for longlong2str() storage/maria/ma_dbug.c: longlong2str() -> longlong10_to_str() storage/maria/maria_chk.c: Added extra argument to longlong2str storage/myisam/mi_dbug.c: longlong2str() -> longlong10_to_str() storage/myisam/myisamchk.c: Added extra argument to longlong2str storage/xtradb/handler/ha_innodb.cc: Update to new parameters for longlong2str() strings/longlong2str.c: Added extra argument to longlong2str() to make it have same prototype is int2str() strings/my_vsnprintf.c: Changed my_vsnprintf() to use longlong2str instead of int2str() to get rid of warnings and to get support for long pointers even when long is 32 bit. Added cast to get rid of compiler warnings
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
15 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
Fix for LP#588251: doStartTableScan() result not checked. The issue was that we didn't always check result of ha_rnd_init() which caused a problem for handlers that returned an error in this code. - Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked. - Added ha_rnd_init_with_error() that prints error on failure. - Checked all usage of ha_rnd_init() and ensure we generate an error message on failures. - Changed init_read_record() to return 1 on failure. sql/create_options.cc: Fixed wrong printf sql/event_db_repository.cc: Check result from init_read_record() sql/events.cc: Check result from init_read_record() sql/filesort.cc: Check result from ha_rnd_init() sql/ha_partition.cc: Check result from ha_rnd_init() sql/ha_partition.h: Fixed compiler warning sql/handler.cc: Added ha_rnd_init_with_error() Check result from ha_rnd_init() sql/handler.h: Added ha_rnd_init_with_error() Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked sql/item_subselect.cc: Check result from ha_rnd_init() sql/log.cc: Check result from ha_rnd_init() sql/log_event.cc: Check result from ha_rnd_init() sql/log_event_old.cc: Check result from ha_rnd_init() sql/mysql_priv.h: init_read_record() now returns error code on failure sql/opt_range.cc: Check result from ha_rnd_init() sql/records.cc: init_read_record() now returns error code on failure Check result from ha_rnd_init() sql/sql_acl.cc: Check result from init_read_record() sql/sql_cursor.cc: Print error if ha_rnd_init() fails sql/sql_delete.cc: Check result from init_read_record() sql/sql_help.cc: Check result from init_read_record() sql/sql_plugin.cc: Check result from init_read_record() sql/sql_select.cc: Check result from ha_rnd_init() Print error if ha_rnd_init() fails. sql/sql_servers.cc: Check result from init_read_record() sql/sql_table.cc: Check result from init_read_record() sql/sql_udf.cc: Check result from init_read_record() sql/sql_update.cc: Check result from init_read_record() storage/example/ha_example.cc: Don't return error on rnd_init() storage/ibmdb2i/ha_ibmdb2i.cc: Removed not relevant comment
16 years ago
Fix for LP#588251: doStartTableScan() result not checked. The issue was that we didn't always check result of ha_rnd_init() which caused a problem for handlers that returned an error in this code. - Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked. - Added ha_rnd_init_with_error() that prints error on failure. - Checked all usage of ha_rnd_init() and ensure we generate an error message on failures. - Changed init_read_record() to return 1 on failure. sql/create_options.cc: Fixed wrong printf sql/event_db_repository.cc: Check result from init_read_record() sql/events.cc: Check result from init_read_record() sql/filesort.cc: Check result from ha_rnd_init() sql/ha_partition.cc: Check result from ha_rnd_init() sql/ha_partition.h: Fixed compiler warning sql/handler.cc: Added ha_rnd_init_with_error() Check result from ha_rnd_init() sql/handler.h: Added ha_rnd_init_with_error() Changed prototype of ha_rnd_init() to ensure that we get a compile warning if result is not checked sql/item_subselect.cc: Check result from ha_rnd_init() sql/log.cc: Check result from ha_rnd_init() sql/log_event.cc: Check result from ha_rnd_init() sql/log_event_old.cc: Check result from ha_rnd_init() sql/mysql_priv.h: init_read_record() now returns error code on failure sql/opt_range.cc: Check result from ha_rnd_init() sql/records.cc: init_read_record() now returns error code on failure Check result from ha_rnd_init() sql/sql_acl.cc: Check result from init_read_record() sql/sql_cursor.cc: Print error if ha_rnd_init() fails sql/sql_delete.cc: Check result from init_read_record() sql/sql_help.cc: Check result from init_read_record() sql/sql_plugin.cc: Check result from init_read_record() sql/sql_select.cc: Check result from ha_rnd_init() Print error if ha_rnd_init() fails. sql/sql_servers.cc: Check result from init_read_record() sql/sql_table.cc: Check result from init_read_record() sql/sql_udf.cc: Check result from init_read_record() sql/sql_update.cc: Check result from init_read_record() storage/example/ha_example.cc: Don't return error on rnd_init() storage/ibmdb2i/ha_ibmdb2i.cc: Removed not relevant comment
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
MWL#43 CREATE TABLE options (by Sanja) Docs/sp-imp-spec.txt: New sql_mode added. include/my_base.h: Flag in frm of create options. libmysqld/CMakeLists.txt: New files added. libmysqld/Makefile.am: New files added. mysql-test/r/events_bugs.result: New sql_mode added. mysql-test/r/information_schema.result: New sql_mode added. mysql-test/r/sp.result: New sql_mode added. mysql-test/r/system_mysql_db.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql.result: New sql_mode added. mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result: New sql_mode added. mysql-test/t/events_bugs.test: New sql_mode added. mysql-test/t/sp.test: New sql_mode added. scripts/mysql_system_tables.sql: New sql_mode added. scripts/mysql_system_tables_fix.sql: New sql_mode added. sql/CMakeLists.txt: New files added. sql/Makefile.am: New files added. sql/event_db_repository.cc: New sql_mode added. sql/field.cc: Create options support added. sql/field.h: Create options support added. sql/ha_partition.cc: Create options support added. sql/handler.cc: Create options support added. sql/handler.h: Create options support added. sql/log_event.h: New sql_mode added. sql/mysql_priv.h: New sql_mode added. sql/mysqld.cc: New sql_mode added. sql/share/errmsg.txt: New error messages added. sql/sp.cc: New sql_mode added. sql/sp_head.cc: Create options support added. sql/sql_class.cc: Create options support added. Debug added. sql/sql_class.h: Create options support added. sql/sql_insert.cc: my_safe_a* moved to mysqld_priv.h sql/sql_lex.h: Create options support added. sql/sql_parse.cc: Create options support added. sql/sql_show.cc: Create options support added. sql/sql_table.cc: Create options support added. sql/sql_view.cc: New sql_mode added. sql/sql_yacc.yy: Create options support added. sql/structs.h: Create options support added. sql/table.cc: Create options support added. sql/table.h: Create options support added. sql/unireg.cc: Create options support added. storage/example/ha_example.cc: Create options example. storage/example/ha_example.h: Create options example. storage/pbxt/src/discover_xt.cc: Create options support added.
16 years ago
  1. /* Copyright (C) 2010 Monty Program Ab
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. /**
  13. @file
  14. Engine defined options of tables/fields/keys in CREATE/ALTER TABLE.
  15. */
  16. #include "create_options.h"
  17. #include <my_getopt.h>
  18. #define FRM_QUOTED_VALUE 0x8000
  19. /**
  20. Links this item to the given list end
  21. @param start The list beginning or NULL
  22. @param end The list last element or does not matter
  23. */
  24. void engine_option_value::link(engine_option_value **start,
  25. engine_option_value **end)
  26. {
  27. DBUG_ENTER("engine_option_value::link");
  28. DBUG_PRINT("enter", ("name: '%s' (%u) value: '%s' (%u)",
  29. name.str, (uint) name.length,
  30. value.str, (uint) value.length));
  31. engine_option_value *opt;
  32. /* check duplicates to avoid writing them to frm*/
  33. for(opt= *start;
  34. opt && ((opt->parsed && !opt->value.str) ||
  35. my_strnncoll(system_charset_info,
  36. (uchar *)name.str, name.length,
  37. (uchar*)opt->name.str, opt->name.length));
  38. opt= opt->next) /* no-op */;
  39. if (opt)
  40. {
  41. opt->value.str= NULL; /* remove previous value */
  42. opt->parsed= TRUE; /* and don't issue warnings for it anymore */
  43. }
  44. /*
  45. Add this option to the end of the list
  46. @note: We add even if it is opt->value.str == NULL because it can be
  47. ALTER TABLE to remove the option.
  48. */
  49. if (*start)
  50. {
  51. (*end)->next= this;
  52. *end= this;
  53. }
  54. else
  55. {
  56. /*
  57. note that is *start == 0, the value of *end does not matter,
  58. it can be uninitialized.
  59. */
  60. *start= *end= this;
  61. }
  62. DBUG_VOID_RETURN;
  63. }
  64. static bool report_wrong_value(THD *thd, const char *name, const char *val,
  65. my_bool suppress_warning)
  66. {
  67. if (suppress_warning)
  68. return 0;
  69. if (!(thd->variables.sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS) &&
  70. !thd->slave_thread)
  71. {
  72. my_error(ER_BAD_OPTION_VALUE, MYF(0), val, name);
  73. return 1;
  74. }
  75. push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BAD_OPTION_VALUE,
  76. ER(ER_BAD_OPTION_VALUE), val, name);
  77. return 0;
  78. }
  79. static bool report_unknown_option(THD *thd, engine_option_value *val,
  80. my_bool suppress_warning)
  81. {
  82. DBUG_ENTER("report_unknown_option");
  83. if (val->parsed || suppress_warning)
  84. {
  85. DBUG_PRINT("info", ("parsed => exiting"));
  86. DBUG_RETURN(FALSE);
  87. }
  88. if (!(thd->variables.sql_mode & MODE_IGNORE_BAD_TABLE_OPTIONS) &&
  89. !thd->slave_thread)
  90. {
  91. my_error(ER_UNKNOWN_OPTION, MYF(0), val->name.str);
  92. DBUG_RETURN(TRUE);
  93. }
  94. push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
  95. ER_UNKNOWN_OPTION, ER(ER_UNKNOWN_OPTION), val->name.str);
  96. DBUG_RETURN(FALSE);
  97. }
  98. static bool set_one_value(ha_create_table_option *opt,
  99. THD *thd, LEX_STRING *value, void *base,
  100. my_bool suppress_warning,
  101. MEM_ROOT *root)
  102. {
  103. DBUG_ENTER("set_one_value");
  104. DBUG_PRINT("enter", ("opt: 0x%lx type: %u name '%s' value: '%s'",
  105. (ulong) opt,
  106. opt->type, opt->name,
  107. (value->str ? value->str : "<DEFAULT>")));
  108. switch (opt->type)
  109. {
  110. case HA_OPTION_TYPE_ULL:
  111. {
  112. ulonglong *val= (ulonglong*)((char*)base + opt->offset);
  113. if (!value->str)
  114. {
  115. *val= opt->def_value;
  116. DBUG_RETURN(0);
  117. }
  118. my_option optp=
  119. { opt->name, 1, 0, (uchar **)val, 0, 0, GET_ULL,
  120. REQUIRED_ARG,
  121. (longlong) opt->def_value,
  122. (longlong) opt->min_value,
  123. opt->max_value,
  124. 0, (long) opt->block_size, 0};
  125. ulonglong orig_val= strtoull(value->str, NULL, 10);
  126. my_bool unused;
  127. *val= orig_val;
  128. *val= getopt_ull_limit_value(*val, &optp, &unused);
  129. if (*val == orig_val)
  130. DBUG_RETURN(0);
  131. DBUG_RETURN(report_wrong_value(thd, opt->name, value->str,
  132. suppress_warning));
  133. }
  134. case HA_OPTION_TYPE_STRING:
  135. {
  136. char **val= (char **)((char *)base + opt->offset);
  137. if (!value->str)
  138. {
  139. *val= 0;
  140. DBUG_RETURN(0);
  141. }
  142. if (!(*val= strmake_root(root, value->str, value->length)))
  143. DBUG_RETURN(1);
  144. DBUG_RETURN(0);
  145. }
  146. case HA_OPTION_TYPE_ENUM:
  147. {
  148. uint *val= (uint *)((char *)base + opt->offset), num;
  149. *val= (uint) opt->def_value;
  150. if (!value->str)
  151. DBUG_RETURN(0);
  152. const char *start= opt->values, *end;
  153. num= 0;
  154. while (*start)
  155. {
  156. for (end=start;
  157. *end && *end != ',';
  158. end+= my_mbcharlen(system_charset_info, *end)) /* no-op */;
  159. if (!my_strnncoll(system_charset_info,
  160. (uchar*)start, end-start,
  161. (uchar*)value->str, value->length))
  162. {
  163. *val= num;
  164. DBUG_RETURN(0);
  165. }
  166. if (*end)
  167. end++;
  168. start= end;
  169. num++;
  170. }
  171. DBUG_RETURN(report_wrong_value(thd, opt->name, value->str,
  172. suppress_warning));
  173. }
  174. case HA_OPTION_TYPE_BOOL:
  175. {
  176. bool *val= (bool *)((char *)base + opt->offset);
  177. *val= opt->def_value;
  178. if (!value->str)
  179. DBUG_RETURN(0);
  180. if (!my_strnncoll(system_charset_info,
  181. (const uchar*)"NO", 2,
  182. (uchar *)value->str, value->length) ||
  183. !my_strnncoll(system_charset_info,
  184. (const uchar*)"OFF", 3,
  185. (uchar *)value->str, value->length) ||
  186. !my_strnncoll(system_charset_info,
  187. (const uchar*)"0", 1,
  188. (uchar *)value->str, value->length))
  189. {
  190. *val= FALSE;
  191. DBUG_RETURN(FALSE);
  192. }
  193. if (!my_strnncoll(system_charset_info,
  194. (const uchar*)"YES", 3,
  195. (uchar *)value->str, value->length) ||
  196. !my_strnncoll(system_charset_info,
  197. (const uchar*)"ON", 2,
  198. (uchar *)value->str, value->length) ||
  199. !my_strnncoll(system_charset_info,
  200. (const uchar*)"1", 1,
  201. (uchar *)value->str, value->length))
  202. {
  203. *val= TRUE;
  204. DBUG_RETURN(FALSE);
  205. }
  206. DBUG_RETURN(report_wrong_value(thd, opt->name, value->str,
  207. suppress_warning));
  208. }
  209. }
  210. DBUG_ASSERT(0);
  211. my_error(ER_UNKNOWN_ERROR, MYF(0));
  212. DBUG_RETURN(1);
  213. }
  214. static const size_t ha_option_type_sizeof[]=
  215. { sizeof(ulonglong), sizeof(char *), sizeof(uint), sizeof(bool)};
  216. /**
  217. Creates option structure and parses list of options in it
  218. @param thd thread handler
  219. @param option_struct where to store pointer on the option struct
  220. @param option_list list of options given by user
  221. @param rules list of option description by engine
  222. @param suppress_warning second parse so we do not need warnings
  223. @param root MEM_ROOT where allocate memory
  224. @retval TRUE Error
  225. @retval FALSE OK
  226. */
  227. my_bool parse_option_list(THD* thd, void *option_struct_arg,
  228. engine_option_value *option_list,
  229. ha_create_table_option *rules,
  230. my_bool suppress_warning,
  231. MEM_ROOT *root)
  232. {
  233. ha_create_table_option *opt;
  234. size_t option_struct_size= 0;
  235. engine_option_value *val= option_list;
  236. void **option_struct= (void**)option_struct_arg;
  237. DBUG_ENTER("parse_option_list");
  238. DBUG_PRINT("enter",
  239. ("struct: 0x%lx list: 0x%lx rules: 0x%lx suppres %u root 0x%lx",
  240. (ulong) *option_struct, (ulong)option_list, (ulong)rules,
  241. (uint) suppress_warning, (ulong) root));
  242. if (rules)
  243. {
  244. LEX_STRING default_val= {NULL, 0};
  245. for (opt= rules; opt->name; opt++)
  246. set_if_bigger(option_struct_size, opt->offset +
  247. ha_option_type_sizeof[opt->type]);
  248. *option_struct= alloc_root(root, option_struct_size);
  249. /* set all values to default */
  250. for (opt= rules; opt->name; opt++)
  251. set_one_value(opt, thd, &default_val, *option_struct,
  252. suppress_warning, root);
  253. }
  254. for (; val; val= val->next)
  255. {
  256. for (opt= rules; opt && opt->name; opt++)
  257. {
  258. if (my_strnncoll(system_charset_info,
  259. (uchar*)opt->name, opt->name_length,
  260. (uchar*)val->name.str, val->name.length))
  261. continue;
  262. if (set_one_value(opt, thd, &val->value,
  263. *option_struct, suppress_warning || val->parsed, root))
  264. DBUG_RETURN(TRUE);
  265. val->parsed= true;
  266. break;
  267. }
  268. if (report_unknown_option(thd, val, suppress_warning))
  269. DBUG_RETURN(TRUE);
  270. val->parsed= true;
  271. }
  272. DBUG_RETURN(FALSE);
  273. }
  274. /**
  275. Parses all table/fields/keys options
  276. @param thd thread handler
  277. @param file handler of the table
  278. @parem share descriptor of the table
  279. @retval TRUE Error
  280. @retval FALSE OK
  281. */
  282. my_bool parse_engine_table_options(THD *thd, handlerton *ht,
  283. TABLE_SHARE *share)
  284. {
  285. MEM_ROOT *root= &share->mem_root;
  286. DBUG_ENTER("parse_engine_table_options");
  287. if (parse_option_list(thd, &share->option_struct, share->option_list,
  288. ht->table_options, TRUE, root))
  289. DBUG_RETURN(TRUE);
  290. for (Field **field= share->field; *field; field++)
  291. {
  292. if (parse_option_list(thd, &(*field)->option_struct, (*field)->option_list,
  293. ht->field_options, TRUE, root))
  294. DBUG_RETURN(TRUE);
  295. }
  296. for (uint index= 0; index < share->keys; index ++)
  297. {
  298. if (parse_option_list(thd, &share->key_info[index].option_struct,
  299. share->key_info[index].option_list,
  300. ht->index_options, TRUE, root))
  301. DBUG_RETURN(TRUE);
  302. }
  303. DBUG_RETURN(FALSE);
  304. }
  305. /**
  306. Returns representation length of key and value in the frm file
  307. */
  308. uint engine_option_value::frm_length()
  309. {
  310. /*
  311. 1 byte - name length
  312. 2 bytes - value length
  313. if value.str is NULL, this option is not written to frm (=DEFAULT)
  314. */
  315. return value.str ? 1 + name.length + 2 + value.length : 0;
  316. }
  317. /**
  318. Returns length of representation of option list in the frm file
  319. */
  320. static uint option_list_frm_length(engine_option_value *opt)
  321. {
  322. uint res= 0;
  323. for (; opt; opt= opt->next)
  324. res+= opt->frm_length();
  325. return res;
  326. }
  327. /**
  328. Calculates length of options image in the .frm
  329. @param table_option_list list of table options
  330. @param create_fields field descriptors list
  331. @param keys number of keys
  332. @param key_info array of key descriptors
  333. @returns length of image in frm
  334. */
  335. uint engine_table_options_frm_length(engine_option_value *table_option_list,
  336. List<Create_field> &create_fields,
  337. uint keys, KEY *key_info)
  338. {
  339. List_iterator<Create_field> it(create_fields);
  340. Create_field *field;
  341. uint res, index;
  342. DBUG_ENTER("engine_table_options_frm_length");
  343. res= option_list_frm_length(table_option_list);
  344. while ((field= it++))
  345. res+= option_list_frm_length(field->option_list);
  346. for (index= 0; index < keys; index++, key_info++)
  347. res+= option_list_frm_length(key_info->option_list);
  348. /*
  349. if there's at least one option somewhere (res > 0)
  350. we write option lists for all fields and keys, zero-terminated.
  351. If there're no options we write nothing at all (backward compatibility)
  352. */
  353. DBUG_RETURN(res ? res + 1 + create_fields.elements + keys : 0);
  354. }
  355. /**
  356. Writes image of the key and value to the frm image buffer
  357. @param buff pointer to the buffer free space beginning
  358. @returns pointer to byte after last recorded in the buffer
  359. */
  360. uchar *engine_option_value::frm_image(uchar *buff)
  361. {
  362. if (value.str)
  363. {
  364. *buff++= name.length;
  365. memcpy(buff, name.str, name.length);
  366. buff+= name.length;
  367. int2store(buff, value.length | (quoted_value ? FRM_QUOTED_VALUE : 0));
  368. buff+= 2;
  369. memcpy(buff, (const uchar *) value.str, value.length);
  370. buff+= value.length;
  371. }
  372. return buff;
  373. }
  374. /**
  375. Writes image of the key and value to the frm image buffer
  376. @param buff pointer to the buffer to store the options in
  377. @param opt list of options;
  378. @returns pointer to the end of the stored data in the buffer
  379. */
  380. static uchar *option_list_frm_image(uchar *buff, engine_option_value *opt)
  381. {
  382. for (; opt; opt= opt->next)
  383. buff= opt->frm_image(buff);
  384. *buff++= 0;
  385. return buff;
  386. }
  387. /**
  388. Writes options image in the .frm buffer
  389. @param buff pointer to the buffer
  390. @param table_option_list list of table options
  391. @param create_fields field descriptors list
  392. @param keys number of keys
  393. @param key_info array of key descriptors
  394. @returns pointer to byte after last recorded in the buffer
  395. */
  396. uchar *engine_table_options_frm_image(uchar *buff,
  397. engine_option_value *table_option_list,
  398. List<Create_field> &create_fields,
  399. uint keys, KEY *key_info)
  400. {
  401. List_iterator<Create_field> it(create_fields);
  402. Create_field *field;
  403. KEY *key_info_end= key_info + keys;
  404. DBUG_ENTER("engine_table_options_frm_image");
  405. buff= option_list_frm_image(buff, table_option_list);
  406. while ((field= it++))
  407. buff= option_list_frm_image(buff, field->option_list);
  408. while (key_info < key_info_end)
  409. buff= option_list_frm_image(buff, (key_info++)->option_list);
  410. DBUG_RETURN(buff);
  411. }
  412. /**
  413. Reads name and value from buffer, then link it in the list
  414. @param buff the buffer to read from
  415. @param start The list beginning or NULL
  416. @param end The list last element or does not matter
  417. @param root MEM_ROOT for allocating
  418. @returns pointer to byte after last recorded in the buffer
  419. */
  420. uchar *engine_option_value::frm_read(const uchar *buff, engine_option_value **start,
  421. engine_option_value **end, MEM_ROOT *root)
  422. {
  423. LEX_STRING name, value;
  424. uint len;
  425. name.length= buff[0];
  426. buff++;
  427. if (!(name.str= strmake_root(root, (const char*)buff, name.length)))
  428. return NULL;
  429. buff+= name.length;
  430. len= uint2korr(buff);
  431. value.length= len & ~FRM_QUOTED_VALUE;
  432. buff+= 2;
  433. if (!(value.str= strmake_root(root, (const char*)buff, value.length)))
  434. return NULL;
  435. buff+= value.length;
  436. engine_option_value *ptr=new (root)
  437. engine_option_value(name, value, len & FRM_QUOTED_VALUE, start, end);
  438. if (!ptr)
  439. return NULL;
  440. return (uchar *)buff;
  441. }
  442. /**
  443. Reads options from this buffer
  444. @param buff the buffer to read from
  445. @param length buffer length
  446. @param share table descriptor
  447. @param root MEM_ROOT for allocating
  448. @retval TRUE Error
  449. @retval FALSE OK
  450. */
  451. my_bool engine_table_options_frm_read(const uchar *buff, uint length,
  452. TABLE_SHARE *share)
  453. {
  454. const uchar *buff_end= buff + length;
  455. engine_option_value *UNINIT_VAR(end);
  456. MEM_ROOT *root= &share->mem_root;
  457. uint count;
  458. DBUG_ENTER("engine_table_options_frm_read");
  459. while (buff < buff_end && *buff)
  460. {
  461. if (!(buff= engine_option_value::frm_read(buff, &share->option_list, &end,
  462. root)))
  463. DBUG_RETURN(TRUE);
  464. }
  465. buff++;
  466. for (count=0; count < share->fields; count++)
  467. {
  468. while (buff < buff_end && *buff)
  469. {
  470. if (!(buff= engine_option_value::frm_read(buff,
  471. &share->field[count]->option_list,
  472. &end, root)))
  473. DBUG_RETURN(TRUE);
  474. }
  475. buff++;
  476. }
  477. for (count=0; count < share->keys; count++)
  478. {
  479. while (buff < buff_end && *buff)
  480. {
  481. if (!(buff= engine_option_value::frm_read(buff,
  482. &share->key_info[count].option_list,
  483. &end, root)))
  484. DBUG_RETURN(TRUE);
  485. }
  486. buff++;
  487. }
  488. if (buff < buff_end)
  489. sql_print_warning("Table '%s' was created in a later MariaDB version - "
  490. "unknown table attributes were ignored",
  491. share->table_name.str);
  492. DBUG_RETURN(buff > buff_end);
  493. }
  494. /**
  495. Merges two lists of engine_option_value's with duplicate removal.
  496. */
  497. engine_option_value *merge_engine_table_options(engine_option_value *first,
  498. engine_option_value *second,
  499. MEM_ROOT *root)
  500. {
  501. engine_option_value *end, *opt;
  502. DBUG_ENTER("merge_engine_table_options");
  503. LINT_INIT(end);
  504. /* find last element */
  505. if (first && second)
  506. for (end= first; end->next; end= end->next) /* no-op */;
  507. for (opt= second; opt; opt= opt->next)
  508. new (root) engine_option_value(opt->name, opt->value, opt->quoted_value,
  509. &first, &end);
  510. DBUG_RETURN(first);
  511. }