Open hb-- opened 11 years ago
To compile and link all sources and objects I made the following changes:
$ mc gnv$gnu:[bin]diff -ub SHELL.C-orig SHELL.C
--- SHELL.C-orig Thu Mar 14 14:26:40 2013
+++ SHELL.C Thu Mar 14 13:54:13 2013
@@ -2916,7 +2916,7 @@
sqlite3_initialize();
sqliterc = "SQLITERC";
}
- in = fopen(sqliterc,"rb" dna="SYS$LOGIN:.DAT");
+ in = fopen(sqliterc,"rb","dna=SYS$LOGIN:.DAT");
#endif /* !VMS */
if( in ){
if( stdin_is_interactive ){
$ mc gnv$gnu:[bin]diff -ub DESCRIP.MMS-orig DESCRIP.MMS
--- DESCRIP.MMS-orig Thu Mar 14 14:26:28 2013
+++ DESCRIP.MMS Thu Mar 14 14:07:05 2013
@@ -55,7 +55,7 @@
$(CC)$(CFLAGS) $(MMS$SOURCE)
.ELSE
CFLAGS = $(CFLAGS)/WARN=DISABLE=(LONGEXTERN,EMPTYFILE) -
- /FRIST_INCLUDE=$(ETCDIR)CONFIG.H/FLOAT=IEEE_FLOAT/NAME=AS_IS
+ /FIRST_INCLUDE=$(ETCDIR)CONFIG.H/FLOAT=IEEE_FLOAT/NAME=AS_IS
{$(SRCDIR)}.C{$(BINDIR)}.OBJ :
$(CC)$(CFLAGS) $(MMS$SOURCE)+SYS$LIBRARY:SYS$LIB_C/LIB
@@ -76,6 +76,7 @@
$(BINDIR)INSERT.OBJ,$(BINDIR)JOURNAL.OBJ,$(BINDIR)LEGACY.OBJ,-
$(BINDIR)LOADEXT.OBJ,$(BINDIR)MAIN.OBJ,$(BINDIR)MALLOC.OBJ,-
$(BINDIR)MEMJOURNAL.OBJ,$(BINDIR)MEMVMS.OBJ,$(BINDIR)MUTEX.OBJ,-
+ $(BINDIR)MUTEX_NOOP.OBJ,-
$(BINDIR)MUTEX_VMS.OBJ,$(BINDIR)NOTIFY.OBJ,$(BINDIR)OPCODES.OBJ,-
$(BINDIR)OS.OBJ,$(BINDIR)OS_VMS.OBJ,$(BINDIR)PAGER.OBJ,-
$(BINDIR)PARSE.OBJ,$(BINDIR)PCACHE.OBJ,$(BINDIR)PCACHE1.OBJ,-
@@ -85,7 +86,8 @@
$(BINDIR)TABLE.OBJ,$(BINDIR)TOKENIZE.OBJ,$(BINDIR)TRIGGER.OBJ,-
$(BINDIR)UPDATE.OBJ,$(BINDIR)UTF.OBJ,$(BINDIR)UTIL.OBJ,-
$(BINDIR)VACUUM.OBJ,$(BINDIR)VDBE.OBJ,$(BINDIR)VDBEAPI.OBJ,-
- $(BINDIR)VDBEAUX.OBJ,$(BINDIR)VDBEBLOB.OBJ,$(BINDIR)VDBETRACE.OBJ,-
+ $(BINDIR)VDBEAUX.OBJ,$(BINDIR)VDBEBLOB.OBJ,$(BINDIR)VDBEMEM.OBJ,-
+ $(BINDIR)VDBESORT.OBJ,$(BINDIR)VDBETRACE.OBJ,-
$(BINDIR)VTAB.OBJ,$(BINDIR)WAL.OBJ,$(BINDIR)WALKER.OBJ,-
$(BINDIR)WHERE.OBJ
@@ -97,7 +99,7 @@
$(BINDIR)SQLITE3.EXE : $(ETCDIR)CONFIG.H,-
$(BINDIR)SHELL.OBJ,$(BINDIR)SQLITE3_SHR.EXE,-
$(SRCDIR)SQLITE3$(OPT),$(ETCDIR)VERSION.OPT
- DEFINE/USER $(FILENAME $(MMS$TARGET)) $(MMS$TARGET)
+! DEFINE/USER $(FILENAME $(MMS$TARGET)) $(MMS$TARGET)
$(LINK)/EXE=$(MMS$TARGET) $(SRCDIR)SQLITE3$(OPT)/OPT
$(ETCDIR)VERSION.OPT : $(SRCDIR)SQLITE3.H
$
With some linker magic I could generate the shareable and the main image. However, they don't work as expected:
$ def/user SQLITE3_SHR USR_SCRATCH:[SQLITE3.BIN-AXP]SQLITE3_SHR
$ mc USR_SCRATCH:[SQLITE3.BIN-AXP]SQLITE3 x.db
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .databases
Error: unable to open database "x.db": unable to open database file
$
So either my changes are totally off or it isn't soup, yet.
Hi hb,
Thanks for the patches. I did some work quite a while back to build a native OS driver for SQLite, rather than the UNIX-compatibility stuff. All my work, so far, has been done on VAX using the GCC compiler (to cope with the 64-bit issue). When I come up against things that I know while be needed for Alpha/Itanium (say the /FIRST_INCLUDE vs. /SCAN) I chuck it in. However, none of it has actually been run so stupid spelling mistakes haven't been caught yet.
As for the shareable image...I've got a TECO macro I've been working on that processes the object file listing, but also constructs it against an existing symbol vector, so we don't jumble around the entry points. I have to finish the bit that generates the output and then push it. I've been working on a few other things the last couple days, so still need to get round to it.
As for soup...well, I have had it running on VAX (but that was a couple versions ago) and it ran very well. Given at the time my development system was a VAXstation 4000/VLC, performance was really quick. I'll have to put together some metrics.
I'll review the other changes you submitted too and roll them in as well. I certainly appreciate your input, please keep it coming.
Thanks Tim.
Hi Tim,
Some more notes and questions. Feel free to add them to - the closed - issue #1.
Did you create a shareable image on Vax, with a transfer vector?
The SQLITE3_SHR.VAX_OPT seems incomplete, at least for building a shareable image. Or did you use it to link the main image, aka shell?
Do I need zlib (on Alpha) as well? I didn't have it for sqlite3 3.7.14.1.
For Vax the options say BIN_DIR:SQLITE3_SHR.OLB/LIB, but for Alpha the OLB is SQLITE3.OLB (and there is no device nor logical bin_dir).
Temporarily I simply use
$ dir [.BIN-AXP].obj;/notrailer/noheader/select=file=(notype,noversion)/exclude=shell.*/out=SQLITE3_SHR.AXP_OPT
to add all the objects to the shareable image. What is the OLB good for, anyway?
To be honest, I have no idea how to use teco with .tes. And there is no action or hint in the descrip.mms. On the other hand, I'm sure you are aware that it is not recommended to construct the symbol vector out of all global symbols. It would be better to use anything describing the public interface, such as the required include files.
There is no rule/action to generate SQLITE3.AXP_OPT. Temporarily and manually invoked after creating the shareable, I use
$ dir [.BIN-AXP]shell.obj;/notrailer/noheader/select=file=(notype,noversion)/out=SQLITE3.AXP_OPT $ pipe write sys$output f$search("[.bin-axp]SQLITE3_SHR.exe;")+"/share" |append sys$pipe SQLITE3.AXP_OPT
Up to now, you didn't check or apply the patch to shell.c. Is the "rb" dna="SYS$LOGIN:.DAT" valid on/in or specific to Vax/gcc?
Anyway, the open fails because of %SYSTEM-F-NOSYSLCK, operation requires SYSLCK privilege which - as Joe User - I don't have on EISNER. I understand that you want to enqueue a system wide lock, for shared databases. But there seems to be no locking code to handle a private/unshared db.
Also, it may be useful to signal the error or to log it when SQLITE_DEBUG is enabled (getting that to work especially passing all assertions was another task).
Greetings, hb
On 03/15/2013 02:56 AM, Tim E. Sneddon wrote:
Hi hb,
Thanks for the patches. I did some work quite a while back to build a native OS driver for SQLite, rather than the UNIX-compatibility stuff. All my work, so far, has been done on VAX using the GCC compiler (to cope with the 64-bit issue). When I come up against things that I know while be needed for Alpha/Itanium (say the /FIRST_INCLUDE vs. /SCAN) I chuck it in. However, none of it has actually been run so stupid spelling mistakes haven't been caught yet.
As for the shareable image...I've got a TECO macro I've been working on that processes the object file listing, but also constructs it against an existing symbol vector, so we don't jumble around the entry points. I have to finish the bit that generates the output and then push it. I've been working on a few other things the last couple days, so still need to get round to it.
As for soup...well, I have had it running on VAX (but that was a couple versions ago) and it ran very well. Given at the time my development system was a VAXstation 4000/VLC, performance was really quick. I'll have to put together some metrics.
I'll review the other changes you submitted too and roll them in as well. I certainly appreciate your input, please keep it coming.
Thanks Tim.
— Reply to this email directly or view it on GitHub https://github.com/endlesssoftware/sqlite3/issues/1#issuecomment-14940055.
Only in .: bin-axp Only in .: debug.mms diff -rub ../sqlite3-master/descrip.mms ./descrip.mms --- ../sqlite3-master/descrip.mms Fri Mar 15 00:50:41 2013 +++ ./descrip.mms Fri Mar 15 16:46:00 2013 @@ -90,15 +90,16 @@ $(BINDIR)VDBESORT.OBJ,$(BINDIR)VDBETRACE.OBJ,$(BINDIR)VTAB.OBJ,- $(BINDIR)WAL.OBJ,$(BINDIR)WALKER.OBJ,$(BINDIR)WHERE.OBJ
-$(BINDIR)SQLITE3_SHR.EXE : $(ETCDIR)CONFIG.H,-
$(LINK)/SHARE=$(MMS$TARGET) $(SRCDIR)SQLITE3_SHR$(OPT)/OPT
$(BINDIR)SQLITE3.EXE : $(ETCDIR)CONFIG.H,- $(BINDIR)SHELL.OBJ,$(BINDIR)SQLITE3_SHR.EXE,- $(SRCDIR)SQLITE3$(OPT),$(ETCDIR)VERSION.OPT
$(LINK)/SHARE=$(MMS$TARGET) $(SRCDIR)SQLITE3_SHR$(OPT)/OPT,$(ETCDIR)VERSION.OPT/OPT
$(ETCDIR)VERSION.OPT : $(SRCDIR)SQLITE3.H @MAKE_VERSION $(MMS$SOURCE) $(MMS$TARGET) Only in .: etc-axp Only in .: kit-axp diff -rub ../sqlite3-master/shell.c ./shell.c --- ../sqlite3-master/shell.c Fri Mar 15 00:50:41 2013 +++ ./shell.c Fri Mar 15 15:22:27 2013 @@ -2916,7 +2916,7 @@ sqlite3_initialize(); sqliterc = "SQLITERC"; }
if( in ){ if( stdin_is_interactive ){ Only in .: sqlite3.axp_opt Only in .: sqlite3_shr.axp_opt diff -rub ../sqlite3-master/util.c ./util.c --- ../sqlite3-master/util.c Fri Mar 15 00:50:41 2013 +++ ./util.c Fri Mar 15 15:22:27 2013 @@ -386,7 +386,7 @@ if( esign<0 ){ result = 0.0_s; }else{
Hi Tim,
I got a working environment and got sqlite3 to do something: it looks promising. That is I made some changes to built sqlite3 from scratch without manual intervention. The result seems to work. Just for the record, I append what I changed/added. Feel free to use or discard it.
Regards, hb
$ def/user SQLITE3_SHR sys$disk:[.bin-axp]SQLITE3_SHR
$ mc [.bin-axp]sqlite3 x.db
SQLite version 3.7.15.2 2013-01-09 11:53:05
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .databases
seq name file
--- ---------------
----------------------------------------------------------
0 main USR_SCRATCH:[SQLITE3]X.DB
sqlite> create table t1 (t1key INTEGER PRIMARY KEY,data TEXT,num
double,timeEnter DATE);
sqlite> insert into t1 (data,num) values ('This is sample data',3);
sqlite> insert into t1 (data,num) values ('More sample data',6);
sqlite> insert into t1 (data,num) values ('And a little more',9);
sqlite> .quit
$
$ def/user SQLITE3_SHR sys$disk:[.bin-axp]SQLITE3_SHR
$ mc [.bin-axp]sqlite3 x.db "select * from t1;"
1|This is sample data|3.0|
2|More sample data|6.0|
3|And a little more|9.0|
$
diff -rubNp ../sqlite3-master/descrip.mms ./descrip.mms
--- ../sqlite3-master/descrip.mms Fri Mar 15 20:12:25 2013
+++ ./descrip.mms Sat Mar 16 08:08:13 2013
@@ -90,15 +90,23 @@ OBJECTS = $(BINDIR)ALTER.OBJ,$(BINDIR)AN
$(BINDIR)VDBESORT.OBJ,$(BINDIR)VDBETRACE.OBJ,$(BINDIR)VTAB.OBJ,-
$(BINDIR)WAL.OBJ,$(BINDIR)WALKER.OBJ,$(BINDIR)WHERE.OBJ
-$(BINDIR)SQLITE3_SHR.EXE : $(ETCDIR)CONFIG.H,-
- $(BINDIR)SQLITE3.OLB($(OBJECTS)),-
- $(SRCDIR)SQLITE3_SHR$(OPT),$(ETCDIR)VERSION.OPT
- $(LINK)/SHARE=$(MMS$TARGET) $(SRCDIR)SQLITE3_SHR$(OPT)/OPT
$(BINDIR)SQLITE3.EXE : $(ETCDIR)CONFIG.H,-
$(BINDIR)SHELL.OBJ,$(BINDIR)SQLITE3_SHR.EXE,-
$(SRCDIR)SQLITE3$(OPT),$(ETCDIR)VERSION.OPT
- $(LINK)/EXE=$(MMS$TARGET) $(SRCDIR)SQLITE3$(OPT)/OPT
+ $(LINK)/EXE=$(MMS$TARGET) $(SRCDIR)SQLITE3$(OPT)/OPT,$(ETCDIR)VERSION.OPT/OPT
+
+$(BINDIR)SQLITE3_SHR.EXE : $(ETCDIR)CONFIG.H,-
+ $(BINDIR)SQLITE3.OLB($(OBJECTS)),-
+ $(SRCDIR)SQLITE3_SHR$(OPT),$(ETCDIR)VERSION.OPT
+ $(LINK)/SHARE=$(MMS$TARGET) $(SRCDIR)SQLITE3_SHR$(OPT)/OPT,$(ETCDIR)VERSION.OPT/OPT
+
+$(SRCDIR)SQLITE3_SHR$(OPT) : $(SRCDIR)SQLITE3.H $(BINDIR)SQLITE3.OLB($(OBJECTS))
+ @MAKE_SHR_OPTS
+
+$(SRCDIR)SQLITE3$(OPT) : $(BINDIR)SHELL.OBJ $(BINDIR)SQLITE3_SHR.EXE
+ DIR $(BINDIR)SHELL.OBJ;/NOTRAILER/NOHEADER/SELECT=FILE=(NOTYPE,NOVERSION)/OUT=$(MMS$TARGET)
+ PIPE WRITE SYS$OUTPUT "$(BINDIR)SQLITE3_SHR.EXE/SHARE" | APPEND SYS$PIPE $(MMS$TARGET)
$(ETCDIR)VERSION.OPT : $(SRCDIR)SQLITE3.H
@MAKE_VERSION $(MMS$SOURCE) $(MMS$TARGET)
@@ -133,3 +141,4 @@ CLEAN :
- DELETE/NOLOG $(BINDIR)*.*;*
- DELETE/NOLOG $(ETCDIR)*.*;*
- DELETE/NOLOG $(KITDIR)*.*;*
+ - DELETE/NOLOG $(SRCDIR)SQLITE3$(OPT);*, $(SRCDIR)SQLITE3_SHR$(OPT);*
diff -rubNp ../sqlite3-master/make_shr_opts.com ./make_shr_opts.com
--- ../sqlite3-master/make_shr_opts.com Wed Dec 31 18:00:00 1969
+++ ./make_shr_opts.com Sat Mar 16 08:11:02 2013
@@ -0,0 +1,54 @@
+$! 2013 March 16
+$!
+$! For the symbol vector, the idea is to let the compiler find the extern
+$! functions and data from whatever is declared in sqlite3.h, which describes
+$! the public interface. However, some other include files may define more than
+$! that interface. And, there are API functions, which are not compiled into
+$! the object modules, maybe because they depend on the configuration.
+$! (Shouldn't config.h be included in sqlite3.h?)
+$! So there are double checks for a match with the SQLITE_API macro on one hand
+$! and the global symbols on the other hand. Yes, I know, these checks - which
+$! are one or two searches per symbol - makes this slow.
+$! Finally note, this command procedures does not produce an upward compatible
+$! symbol vetor.
+$!
+$ dir sys$disk:[.BIN-AXP].obj;/notrailer/noheader -
+ /select=file=(notype,noversion)/exclude=shell.obj -
+ /out=SQLITE3_SHR.AXP_OPT
+$ cre hb.c
+# include "sqlite3.h"
+static int dummy;
+$
+$ CC/WARN=DISABLE=(LONGEXTERN,EMPTYFILE) -
+ /FIRST_INCLUDE=SYS$DISK:[.ETC-AXP]CONFIG.H/FLOAT=IEEE_FLOAT -
+ /NAME=AS_IS SYS$DISK:[]HB.C+SYS$LIBRARY:SYS$LIB_C/LIB -
+ /list/show=(SYMBOLS,CROSS_REFERENCE)/noobj
+$ pipe libr/names [.bin-axp]sqlite3/list -
+ | search sys$pipe "Librarian ",":","Module "/match=nor/exact >olb.lis
+$ search hb.lis " Extern "/out=symbols.lis
+$ open /read in symbols.lis
+$ open/append app SQLITE3_SHR.AXP_OPT
+$ write app "case=yes"
+$ loop:
+$ read/end=xloop/err=xloop in line
+$ line= f$edit(line,"COMPRESS")
+$ symbol= f$element(0," ",line)
+$ def/user sys$output nla0:
+$ def/user sys$error nla0:
+$ search sqlite3.h sqlite_api,'symbol'/match=and/nooutput
+$ if $status .eqs. "%X08D78053" -
+ then $ goto loop
+$ def/user sys$output nla0:
+$ def/user sys$error nla0:
+$ search olb.lis 'symbol'/nooutput
+$ if $status .eqs. "%X08D78053" -
+ then $ goto loop
+$ svtype:=data
+$ if f$element(5," ",line) .eqs. "Function" -
+ then $ svtype:=procedure
+$ write app "symbol_vector=(''symbol'=''svtype')"
+$ goto loop
+$ xloop:
+$ close in
+$ close app
+$ del hb.c;*, hb.lis;*, symbols.lis;*, olb.lis;*
diff -rubNp ../sqlite3-master/os_vms.c ./os_vms.c
--- ../sqlite3-master/os_vms.c Fri Mar 15 20:12:25 2013
+++ ./os_vms.c Sat Mar 16 08:25:50 2013
@@ -754,10 +754,15 @@ static int vmsOpen(
resnam.dsc$b_dtype = DSC$K_DTYPE_T;
resnam.dsc$b_class = DSC$K_CLASS_S;
resnam.dsc$a_pointer = pFile->lock_name;
-
+#ifdef HAVE_SYSLCK
status = sys$enqw(EFN$C_ENF, LCK$K_NLMODE, &pFile->lksb,
LCK$M_NOQUEUE | LCK$M_SYSTEM | LCK$M_EXPEDITE,
&resnam, 0, NULL, NULL, NULL, PSL$C_USER, NULL, NULL);
+#else
+ status = sys$enqw(EFN$C_ENF, LCK$K_NLMODE, &pFile->lksb,
+ LCK$M_NOQUEUE | LCK$M_EXPEDITE,
+ &resnam, 0, NULL, NULL, NULL, PSL$C_USER, NULL, NULL);
+#endif
if( $VMS_STATUS_SUCCESS(status)
&& $VMS_STATUS_SUCCESS(pFile->lksb.status) ){
return SQLITE_OK;
diff -rubNp ../sqlite3-master/shell.c ./shell.c
--- ../sqlite3-master/shell.c Fri Mar 15 20:12:25 2013
+++ ./shell.c Sat Mar 16 05:48:38 2013
@@ -2916,7 +2916,7 @@ static int process_sqliterc(
sqlite3_initialize();
sqliterc = "SQLITERC";
}
- in = fopen(sqliterc,"rb" "dna=SYS$LOGIN:.DAT");
+ in = fopen(sqliterc,"rb", "dna=SYS$LOGIN:.DAT");
#endif /* !VMS */
if( in ){
if( stdin_is_interactive ){
diff -rubNp ../sqlite3-master/util.c ./util.c
--- ../sqlite3-master/util.c Fri Mar 15 20:12:25 2013
+++ ./util.c Sat Mar 16 05:48:38 2013
@@ -386,7 +386,7 @@ do_atof_calc:
if( esign<0 ){
result = 0.0*s;
}else{
- result = 1e308*1e308*s; /* Infinity */
+ result = 1e308L*1e308L*s; /* Infinity */
}
}else{
/* 1.0e+22 is the largest power of 10 than can be
Hi hb,
Sorry it's a bit late, but here is my response. I see you've already sent something more, so I'll finish here and then move on to that one.
Did you create a shareable image on Vax, with a transfer vector?
The SQLITE3_SHR.VAX_OPT seems incomplete, at least for building a
shareable image. Or did you use it to link the main image, aka shell?
All my initial testing and development was done with a monolithic SHELL.EXE. My TECO macro, nearly finished as I've been busy with other things, actually generates it for me.
Do I need zlib (on Alpha) as well? I didn't have it for sqlite3 3.7.14.1.
I have no idea why that is in there. It was a part of my original build procedure I wrote about 18 months ago, it can be dropped if it is not needed. I certainly have no recollection of why it was included.
For Vax the options say BIN_DIR:SQLITE3_SHR.OLB/LIB, but for Alpha the
OLB is SQLITE3.OLB (and there is no device nor logical bin_dir).
Temporarily I simply use
$ dir
[.BIN-AXP].obj;/notrailer/noheader/select=file=(notype,noversion)/exclude=shell.*/out=SQLITE3_SHR.AXP_OPT
to add all the objects to the shareable image. What is the OLB good for,
anyway?
Typically, if I can, I do most of my development on VAX systems. This is so that I don't do anything particularly drastic that makes it difficulty to port back to the older 32-bit environment. Once VAX works I move on to other architectures. As for the object library, well I just tend to gather up my objects. I think it makes it a bit easier to manage.
To be honest, I have no idea how to use teco with .tes. And there is no
action or hint in the descrip.mms. On the other hand, I'm sure you are
aware that it is not recommended to construct the symbol vector out of
all global symbols. It would be better to use anything describing the
public interface, such as the required include files.
There will be rules in the DESCRIP.MMS that know how to run the TECO macros. The current design is to read the listing from the object library, drop any names containing an underscore and before including a name in the symbol vector it looks it up in sqlite3.h to make sure it is public. The symbol vectore is then written out in a human readable format that maintains the order of the symbol. Following that an architecture specific rendering of the table is then written out too.
The macro also checks and reports on new symbols that do not exist in the symbol table, as well as reporting on symbols that have disappeared. I am considering generating a GSMATCH based on the output of this macro.
Up to now, you didn't check or apply the patch to shell.c. Is the
"rb" dna="SYS$LOGIN:.DAT"
valid on/in or specific to Vax/gcc?
I had simply just not gotten round to editting it and storing it back. There were a few silly typos like that because I merged the new SHELL.C with my olds one by hand. I was busy getting the sharable image sorted out and had just not gotten to the point of compiling SHELL.C
Anyway, the open fails because of
%SYSTEM-F-NOSYSLCK, operation requires SYSLCK privilege
which - as Joe User - I don't have on EISNER. I understand that you want
to enqueue a system wide lock, for shared databases. But there seems to
be no locking code to handle a private/unshared db.
The plan is to have SQLITE3_SHR installed with the SYSLCK procedure via an SQLITE3_STARTUP.COM procedure. My plan for release is to ship in a PCSI kit (and possibly VMSINSTAL) which will construct startup procedures, etc. on install.
Also, it may be useful to signal the error or to log it when
SQLITE_DEBUG is enabled (getting that to work especially passing all
assertions was another task).
I will give this some consideration.
Thanks for your comments hb, your input on this has really been welcomed and thoroughly appreciated.
Regards, Tim.
Hi Tim,
I got a working environment and got sqlite3 to do something: it looks
promising. That is I made some changes to built sqlite3 from scratch
without manual intervention. The result seems to work. Just for the
record, I append what I changed/added. Feel free to use or discard it.
Regards,
hb
Hi hb,
This is great news! I'm glad to hear you've got a working environment. I was looking at some of my notes from back when I originally began the port and one of the problems I noticed was in the VACUUM command. After executing it the database file became unusable. I didn't get to figuring it out, but it was a known problem.
Thanks for you patch. I'll look it over and see what bits to pick out.
Thanks again, Tim.
On 03/16/2013 05:52 PM, Tim E. Sneddon wrote:
This is great news! I'm glad to hear you've got a working environment. I was looking at some of my notes from back when I originally began the port and one of the problems I noticed was in the VACUUM command. After executing it the database file became unusable. I didn't get to figuring it out, but it was a known problem.
This seems to be caused by an SS$_ACCONFLICT returned from the qio to truncate the file. I'm not sure when you can get this. The section of the doc I looked up is not very specific about SS$_ACCONFLICT being returned in the IOSB. But there is this: " The truncate subfunction normally requires exclusive access to the file at run time. This means, for example, that a file cannot be truncated while multiple writers have access to it.
An exception occurs when a truncate subfunction is requested for a write-accessed file that allows other readers. Although the truncate subfunction returns success status in this instance, the actual file truncation (the return of the truncated blocks to free storage) is deferred until the last reader deaccesses the file. If a new writer accesses the file after the truncate subfunction is requested, but before the last deaccess, the deferred truncation is ignored. " What I can see (when in the debugger I changed the return code to SUCCESS) is that the file size didn't change at all. But with that hacked return code the db seems to stay intact. On the other hand, I'm not sure whether any failure to truncate needs to be an error at all. From what I understand then releasing the disk space will not take place but the data should have been compressed, anyway.
hb
PS: Is there a reason the include files in the repository are all lowercase and not "sqliteInt.h" and "sqliteLimit.h" as specified in the source code?
Thanks for your notes on VACUUM. I've logged this under issue #4. As for the names of the include files, checkout issue #3.
... and ...