Hi guys,
I've found what I believe is a bug in the INSERT INTO command. If you USE table1 and then USE table2 which is a structural copy of it, calling
Code:
INSERT INTO table1 SELECT * FROM table2
Will stop you from being able to call USE table1 AGAIN.
You can reproduce this in the Lianja/VFP console using the Southwind datbase with the following:
Code:
OPEN DATABASE southwind
USE productsbyname
COPY STRUCTURE TO productsbyname_copy
INSERT INTO productsbyname_copy values(111,"zyx",22,33)
CLOSE ALL
CLOSE DATABASE
OPEN DATABASE southwind
USE productsbyname
USE productsbyname_copy
INSERT INTO productsbyname SELECT * FROM productsbyname_copy
USE productsbyname AGAIN
The first half is only to create an exact copy. That works fine. If you already have a structural copy of a table sitting somewhere else, you can use that instead and see that it's the second half of the above code that causes problems.
The error output is:
Code:
Fri Feb 5 10:56:30 2016
**** Lianja error ****
USE productsbyname AGAIN
^
File 'productsbyname.dbf' does not exist
Finally, here's what's in debug.txt when you SET DEBUG ON and then attempt the above:
Code:
*
* Lianja embedded database engine
* Version 1.3.0
* Compiled on Jan 27 2016 10:38:20
*
Error reported from file rct_use.c line 1091 n=15
cmdline=USE productsbyname AGAIN
g_current=0
database=C:\Lianja\data\southwind\
u->name=<null>
u->alias=<null>
Stacktrace:
*** ERROR *** called from rct_use.c at line 1091 n=15 g_cmdpos=25 g_cmdlen=25 lex=1, g_uci=-1
on error:
error number: 15
error message: File 'productsbyname.dbf' does not exist
cmdbuf: USE productsbyname AGAIN
current=0
database=C:\Lianja\data\southwind\
* u->name=<null>
* u->alias=<null>
Stacktrace:
Is this actually a bug or am I just doing something wrong?
Bookmarks