1. EDS:: db_rename_table fails to define newname as current table, if original was current table

This is virtually the same problem as recently found in db_close():: http://openeuphoria.org/forum/117635.wc?last_id=117653

When the current table is renamed with db_rename_table, the old name continues to be returned by db_current_table(), even though it has been removed from the list returned by db_table_list(), so the renamed table is not identified as the current table.

I have tacked several lines onto the end of db_rename_table in std/eds.e which seems to remedy the problem. Please advise, if you know a better solution - this is pretty much of a shot in the dark:

public procedure db_rename_table(sequence name, sequence new_name) 
-- rename an existing table - written by Jordah Ferguson 
-- 
-- snip 
-- 
	io:seek(current_db, table) 
	put4(table_ptr) 
 
	if table = current_table_pos then  --<<----- 
	    current_table_name = new_name  --<<----- 
	end if                             --<<----- 
 
end procedure 

Regards, Kenneth Rhodes

new topic     » topic index » view message » categorize

2. Re: EDS:: db_rename_table fails to define newname as current table, if original was current table

Thanks Ken, I'll incorporate this fix too.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu