Hello experts, I've got a Ultralite BUG during a database schema upgrade using the ALTER DATABASE SCHEMA FROM FILE command. If I try to add an index to a column of a existent table that already has an indexed column (by schema migration), the Ultralite database becomes invalid and the following error is shown during the database validation: Validation failed: Index validation failed for table Test, index Test with code: 120
Following, I put the steps to reproduce this problem (All steps were done using the SybaseCentral):
The following output is shown: Checking page (1) Validating table Test Validating index primary on table Test Validating index Test on table Test Incorrect row count for index Test on table Test Validating index IX_test on table Test Validating table sysuldata Validating index primary on table sysuldata Validation failed: Index validation failed for table Test, index Test with code: 120 |
Thank you for posting this, and for the repro. We will look into it. At this point I can't think of a workaround other than the obvious :) Tim, please, keep in touch if you have any news about this issue. We have a huge product using the Sybase solution and we are almost deciding if we are going to upgrade our client dabatase using either the ALTER DATABASE command or using DLL executions directly in the database. This decision has been a big "headache" to us =)
(21 Jan '12, 13:19)
Alex
Replies hidden
1
Question: Why not use alter-database-schema-from-file? News: Given what you've provided here, we have reproduced and fixed this bug - thanks. It should be available in build 12.0.1.3558 or later.
(26 Jan '12, 16:16)
Tim McClements
We were wondering if we could use that feature =) Is there a plan to when the next revision will be released?
(27 Jan '12, 07:16)
Alex
Another doubt about why use or not use the ALTER DATABASE command is the renaming of columns and tables. Since the RENAME commands are allowed by Ultralite SQL, it would be a really nice feature if this change could be made using the ALTER DATABASE command. Maybe using a special commented section of the migration script to store a pos-processing batch of SQL commands.
(27 Jan '12, 08:44)
Alex
1
No problem! I don't know exactly when the EBFs will be out, but it should be something like 2 - 6 weeks.
(30 Jan '12, 11:57)
Tim McClements
2
As you say, it would require some special work to add a rename feature to alter-database-from-file. We decided originally not to do it because of the added complication, and we viewed the ability to rename as secondary compared to more substantial and typical schema changes (like adding a column or modifying a column type or adding an index). If you really need rename, then yes, I would suggest you do that with DDL before or after the alter-database statement (depending on whether the new names are in the .sql file or not). Alter-database is a powerful statement because it automatically determines the delta required to move from the current schema to the new one. If you need to do renames (and not knowing exactly how your application works) then you may end up having to track the versions and deltas yourself anyway, in which case you'd have the option of using all individual DDL statements if that suited.
(30 Jan '12, 12:14)
Tim McClements
Ok. We are going to use the alter-database-schema command and maybe some individual DLL executions whenever we need rename some database object. Thank you very much.
(30 Jan '12, 12:53)
Alex
|
I assume this is all done on a Windows desktop? What is your deployment platform?
Yes, but we've tested with the MacOS Desktop as well and the same problem was reproduced. We are targeting the iOS and Android devices (both with the same issue as well)