[yunqa.de] DiSQLite3, possible "Alter table" bug?

  • From: Clyde England <clyde@xxxxxxxx>
  • To: yunqa@xxxxxxxxxxxxx
  • Date: Sun, 20 Dec 2009 17:31:40 +0800

Hi,

I am using DiSQLite3 and have run into a rather bizarre problem when using
"Alter Table"

I am not sure if this is a possible "Sqlite" core bug, or if it is DiSqlite3
specific, or I am just plain doing something stupid.

However I have been able to duplicate with a simple example using just
SQLiteSpy

Also note that the bug only seems to happen when the following conditions
apply:

1. The original table was created by using  the syntax "Create table as
select * ......" . If you create the columns explicitly, it doesn't seem to
be a problem.
2. The new table is create in the "temp" database. That is, we use "Create
Temp table". Creating the table in the main database does not seem to
exhibit the problem.

Try running the following code in SQLiteSpy

create table Bug1 (code,userdata);
create temp table Bug2 as select code,userdata from bug1
Alter Table Bug2 add column xxx;

Now look at the field names in the new table bug2

[image:
?ui=2&view=att&th=125ab2abf6b2f1c8&attid=0.1&disp=attd&realattid=ii_125ab2abf6b2f1c8&zw]

Some how it has renamed the last field to just "use" and then appended the
"rdata" to the end of our new field name

Thanks
Clyde

PNG image

Other related posts: