Loading sql/ha_ndbcluster.cc +27 −0 Original line number Diff line number Diff line Loading @@ -8857,6 +8857,33 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack, DBUG_RETURN(0); } /* get table space info for SHOW CREATE TABLE */ char* ha_ndbcluster::get_tablespace_create_info() { const char tablespace_key[]= " TABLESPACE "; const char storage_key[]= " STORAGE DISK"; char* str= 0; Ndb *ndb= get_ndb(); NDBDICT *ndbdict= ndb->getDictionary(); ndb->setDatabaseName(m_dbname); const NDBTAB *ndbtab= ndbdict->getTable(m_tabname); if (ndbtab == 0) return 0; // TODO retrieve table space name if there is one return 0; const char *tablespace_name= "<name>"; uint len= sizeof(tablespace_key) + strlen(tablespace_name) + sizeof(storage_key); str= my_malloc(len, MYF(0)); strxnmov(str, len, tablespace_key, tablespace_name, storage_key, NullS); return(str); } /* Implements the SHOW NDB STATUS command. */ Loading sql/ha_ndbcluster.h +1 −0 Original line number Diff line number Diff line Loading @@ -700,6 +700,7 @@ static void set_tabname(const char *pathname, char *tabname); uint set_up_partition_info(partition_info *part_info, TABLE *table, void *tab); char* get_tablespace_create_info(); int set_range_data(void *tab, partition_info* part_info); int set_list_data(void *tab, partition_info* part_info); int complemented_pk_read(const byte *old_data, byte *new_data, Loading sql/handler.h +2 −0 Original line number Diff line number Diff line Loading @@ -1713,6 +1713,8 @@ class handler :public Sql_alloc { return FALSE; } virtual char* get_foreign_key_create_info() { return(NULL);} /* gets foreign key create string from InnoDB */ virtual char* get_tablespace_create_info() { return(NULL);} /* gets tablespace create string from handler */ /* used in ALTER TABLE; 1 if changing storage engine is allowed */ virtual bool can_switch_engines() { return 1; } /* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */ Loading sql/sql_show.cc +11 −0 Original line number Diff line number Diff line Loading @@ -1135,6 +1135,17 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN("\n)")); if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) { /* Get possible table space definitions and append them to the CREATE TABLE statement */ if ((for_str= file->get_tablespace_create_info())) { packet->append(for_str, strlen(for_str)); my_free(for_str, MYF(0)); } /* IF check_create_info THEN add ENGINE only if it was used when creating the table Loading Loading
sql/ha_ndbcluster.cc +27 −0 Original line number Diff line number Diff line Loading @@ -8857,6 +8857,33 @@ ha_ndbcluster::generate_scan_filter(Ndb_cond_stack *ndb_cond_stack, DBUG_RETURN(0); } /* get table space info for SHOW CREATE TABLE */ char* ha_ndbcluster::get_tablespace_create_info() { const char tablespace_key[]= " TABLESPACE "; const char storage_key[]= " STORAGE DISK"; char* str= 0; Ndb *ndb= get_ndb(); NDBDICT *ndbdict= ndb->getDictionary(); ndb->setDatabaseName(m_dbname); const NDBTAB *ndbtab= ndbdict->getTable(m_tabname); if (ndbtab == 0) return 0; // TODO retrieve table space name if there is one return 0; const char *tablespace_name= "<name>"; uint len= sizeof(tablespace_key) + strlen(tablespace_name) + sizeof(storage_key); str= my_malloc(len, MYF(0)); strxnmov(str, len, tablespace_key, tablespace_name, storage_key, NullS); return(str); } /* Implements the SHOW NDB STATUS command. */ Loading
sql/ha_ndbcluster.h +1 −0 Original line number Diff line number Diff line Loading @@ -700,6 +700,7 @@ static void set_tabname(const char *pathname, char *tabname); uint set_up_partition_info(partition_info *part_info, TABLE *table, void *tab); char* get_tablespace_create_info(); int set_range_data(void *tab, partition_info* part_info); int set_list_data(void *tab, partition_info* part_info); int complemented_pk_read(const byte *old_data, byte *new_data, Loading
sql/handler.h +2 −0 Original line number Diff line number Diff line Loading @@ -1713,6 +1713,8 @@ class handler :public Sql_alloc { return FALSE; } virtual char* get_foreign_key_create_info() { return(NULL);} /* gets foreign key create string from InnoDB */ virtual char* get_tablespace_create_info() { return(NULL);} /* gets tablespace create string from handler */ /* used in ALTER TABLE; 1 if changing storage engine is allowed */ virtual bool can_switch_engines() { return 1; } /* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */ Loading
sql/sql_show.cc +11 −0 Original line number Diff line number Diff line Loading @@ -1135,6 +1135,17 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, packet->append(STRING_WITH_LEN("\n)")); if (!(thd->variables.sql_mode & MODE_NO_TABLE_OPTIONS) && !foreign_db_mode) { /* Get possible table space definitions and append them to the CREATE TABLE statement */ if ((for_str= file->get_tablespace_create_info())) { packet->append(for_str, strlen(for_str)); my_free(for_str, MYF(0)); } /* IF check_create_info THEN add ENGINE only if it was used when creating the table Loading