[Solved] SQLite - UncachedGetColumns
Posted: 27.03.2021, 20:38
Hello again!
While working with the attached DB (sqlite feature), I discovered a new problem.
When a query is made to a table from the attached DB, the following call chain is executed
Function IsAutoIncrement executes the following query
However, since the work is done through connection of main database, and the table is actually from another database, this query returns an empty dataset. As a consequence, the CreateSQL variable remains an empty string. And then we get an error on the line
At the same time, if I compile ZEOS without the Assertions option, then there is no error, and the IsAutoIncrement function simply returns False (although this is not), but my code continues to work fine.
So my first question is: can i use this trick (disabling Assertions) or it is strongly not reccomended?
This is one half of the problem.
The other part of the problem is that the call
is executed twice, and the second time (line 1440) the second parameter is always = False.
I cant to talk about it is correct or not without knowing all details.
But something tells me that one of the calls is clearly superfluous.
While working with the attached DB (sqlite feature), I discovered a new problem.
When a query is made to a table from the attached DB, the following call chain is executed
Code: Select all
1. TZSQLiteDatabaseMetadata.UncachedGetColumns
2. FillResult
3. IsAutoIncrement
Code: Select all
with GetStatement.ExecuteQuery('select sql from sqlite_master where name = '''+TableName+'''') do
Code: Select all
Assert (CreateSQL <> '')
So my first question is: can i use this trick (disabling Assertions) or it is strongly not reccomended?
This is one half of the problem.
The other part of the problem is that the call
Code: Select all
Result.UpdateBoolean (TableColColumnReadonlyIndex, [Boolean]);
I cant to talk about it is correct or not without knowing all details.
But something tells me that one of the calls is clearly superfluous.