- Added better error messages when trying to open a table that can't be discovered or unpacked. The most likely cause of this is that it does not have any frm data, probably since it has been created from NdbApi or is a NDB system table.
- Separated functionality that was in ha_create_table_from_engine into two functions. One that checks if the table exists and another one that tries to create the table from the engine.
mysql-test/r/ndb_autodiscover.result:
Add tests for reading from a table that can't be discovered(SYSTAB_0)
Discovery is not performed during create table anymore.
mysql-test/t/ndb_autodiscover.test:
Add tests for reading from a table that can't be discovered(SYSTAB_0)
Discovery is not performed during create table anymore.
ndb/test/ndbapi/create_tab.cpp:
Set connectstring before creating Ndb object.
sql/ha_ndbcluster.cc:
Rename and use the function ndbcluster_table_exists_in_engine.
Correct return valu from ndbcluster_discover
Remove old code "ndb_discover_tables"
sql/ha_ndbcluster.h:
Rename function ndbcluster_table_exists to ndb ndbcluster_table_exists_in_engine
sql/handler.cc:
Update comment of ha_create_table_from_engine
Remove parameter create_if_found from ha_create_table_from_engine, the function ha_table_exists_in_engine is now used toi check if table is found in engine.
Cleanup return codes from ha_create_table_from_engine.
Change name of ha_table_exists to ha_table_exists_in_engine, update comment and returne codes.
sql/handler.h:
Remove paramter create_if_cound from ha_create_table_from_engine
Rename ha_table_exists to ha_table_exists_in_engine
sql/sql_base.cc:
Use the function ha_table_exists_in_engine to detect if table exists in enegine.
If it exists, call function ha_create_table_from_engine to try and create it.
If create of table fails, set correct error message.
sql/sql_table.cc:
Add comments, remove parameter create_if_found to ha_create_table_from_engine.
When dropping a table, try to discover it from engine. If discover fails, use same error message as if the table didn't exists.
Maybe another message should be displayed here, ex: "Table could not be dropped, unpack failed"
When creating a new table, use ha_table_exists_in_engine to check if a table with the given name already exists.
1) fix so that missing blob tables don't prevent table from being
dropped
2) decrease size of blob part if record length exceeds max length
3) add test case for table wo/ corresponding blob table
4) init scan counters when sending scan_tabreq
mysql-test/r/ndb_autodiscover.result:
testcase for table wo/ corresponding blob tables
mysql-test/r/ndb_autodiscover2.result:
testcase for table wo/ corresponding blob tables
mysql-test/t/ndb_autodiscover.test:
testcase for table wo/ corresponding blob tables
mysql-test/t/ndb_autodiscover2.test:
testcase for table wo/ corresponding blob tables
ndb/include/ndbapi/NdbDictionary.hpp:
Add non-const get column
ndb/src/ndbapi/NdbDictionary.cpp:
Add non-const get column
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
Allow "partially" getTable, which enables dropping of tables
that fails to create blob tables
ndb/src/ndbapi/NdbScanOperation.cpp:
Init counter when sending SCAN_TABREQ
sql/ha_ndbcluster.cc:
Make sure that blob don't have to big part size
added blob to test to see that blob tables don't show up in show tables
auto increment setting need not fetch blob tables (will otherwise generate error during table creation)
moved addBlobTables out of fetchGlobalTableImpl to get_local_table_info
changed addBlobTables to start from last column and break if all blobs added
also addBlobTables will return -1 if failed (typically getTable)
changed to using get_local_table_info with internal table name where applicable for efficiency
added option to get_local_table_info wether to fetch blob tables or not
getTable always fetches the blobtables
moved addBlobTables to get_local_table_info to always be called, even if main table goes to cache only
mysql-test/r/ndb_autodiscover.result:
added blob to test to see that blob tables don't show up in show tables
mysql-test/t/ndb_autodiscover.test:
added blob to test to see that blob tables don't show up in show tables
ndb/src/ndbapi/Ndb.cpp:
auto increment setting need not fetch blob tables (will otherwise generate error during table creation)
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
moved addBlobTables out of fetchGlobalTableImpl to get_local_table_info
changed addBlobTables to start from last column and break if all blobs added
also addBlobTables will return -1 if failed (typically getTable)
changed to using get_local_table_info with internal table name where applicable for efficiency
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
added option to get_local_table_info wether to fetch blob tables or not
getTable always fetches the blobtables
moved addBlobTables to get_local_table_info to always be called, even if main table goes to cache only
mysql-test/r/ndb_autodiscover.result:
Added test cases to check that SHOW TABLES only show tables in the selected db.
mysql-test/t/ndb_autodiscover.test:
Added test cases to check that SHOW TABLES only show tables in the selected db.
sql/ha_ndbcluster.cc:
Only find files for the current db
Only add files to files list which can be created i.e has a valid frm blob. This prevents NDB$BLOB tables and tables created from NdbApi to show up.
mysql-test/mysql-test-run.sh:
Create and export an NDB_CONNECSTRING that can be used for NDB_TOOLS to connect to NDB
mysql-test/r/ndb_autodiscover.result:
Added more advanced test cases for ndb_autodiscover
mysql-test/t/ndb_autodiscover.test:
Added more advanced test cases for ndb_autodiscover
mysql-test/r/ndb_autodiscover.result:
Update test result, number of rows is 1
mysql-test/t/ndb_autodiscover.test:
Dont run the test where table is dropped in NDb with ndb_drop_table
sql/ha_ndbcluster.cc:
Implement function ndbcluster_find_files which will discover new tables and delete old tables
sql/ha_ndbcluster.h:
Implement function ndbcluster_find_files
Remove function ndbcluster_list_tables and ndbcluster_can_discover
sql/handler.cc:
Add ha_find_files called from mysql_find_files
Remove ha_can_discover and ha_list_tables
sql/handler.h:
Add ha_find_files called from mysql_find_files
Remove ha_can_discover and ha_list_tables
sql/sql_show.cc:
Revert to original version of sql_show.cc
Only changes to this version is that ha_find_files is called from mysql_find_files in order to give the handlers a possibility to find new files in engine
include/my_base.h:
Added new bit to table create options
Removed old error code HA_ERR_OLD_METADAT and reused it for HA_ERR_NO_SUCH_TABLE.
mysql-test/r/ndb_autodiscover.result:
Updated test cases
mysql-test/t/ndb_autodiscover.test:
Updated test cases
mysql-test/t/ndb_autodiscover2.test:
Updated test cases
sql/discover.cc:
Moved function create_table_from_handler to handler.cc
sql/ha_ndbcluster.cc:
Improved discover functionality
Added .ndb file
Changed error code mappings for a table that does not exist in engine
Check for ndb object in THD
Updated ndbcluster_discover, ndbcluster_list_tables and ndbcluster_can_discover
sql/ha_ndbcluster.h:
Improved discover
sql/handler.cc:
Added new error message mapping.
Moved function ha_create_table_from_engine to handler level
Added new functions ha_can_discover, ha_list_tables and ha_table_exists
sql/handler.h:
Added new error message mapping.
Moved function ha_create_table_from_engine to handler level
Added new functions ha_can_discover, ha_list_tables and ha_table_exists
sql/mysql_priv.h:
Removed create_table_from_handler, moved to handler.h
sql/sql_base.cc:
Renamed function create_table_from_handler
sql/sql_show.cc:
Added new function mysql_discover_files and mysql_list_files.
Modified mysql_find_files to discover new and delete "old" files/tables.
sql/sql_table.cc:
Renamed create_table_from_handler
Call ha_create_table_from_engine, in order to discover the the frm file before it can be dropped.
sql/table.cc:
Added mapping of the error code HA_ERR_NO_SUCH_TABLE
mysql-test/r/ndb_autodiscover.result:
Removed one test that needs manual interaction
Added order by in some places
mysql-test/t/ndb_autodiscover.test:
Removed one test that needs manual interaction
Added order by in some places
sql/ha_ndbcluster.cc:
Using HA_WRONG_ASCII_ORDER to activate filesort on a not "sorted" ordered index.
Updated ndb_ test cases
mysql-test/r/ndb_autodiscover.result:
Updated to new output of error message
mysql-test/r/ndb_basic.result:
Added som order by to sort the result correctly before comparing
mysql-test/r/ndb_index_unique.result:
Added test for USING HASH combined with PRIMARY KEY and UNIQUE index
mysql-test/t/ndb_autodiscover.test:
Correctede error case
mysql-test/t/ndb_basic.test:
Added som order by
mysql-test/t/ndb_index_unique.test:
Added test for USING HASH combined with PRIMARY KEY and UNIQUE index
sql/ha_ndbcluster.cc:
Added the index flag HA_ONLY_WHOLE_INDEX if index is created with USING HASH.