Re: [sqlite] Error: malformed database schema - near )

2008-08-09 Thread Mark Easton
Hi Stephen,
 
Many thanks for your response.
 
The database had been working fine. It is actually the second time this has
happened - but luckily our application is not in production yet. Yes, I saw
that thread you are referring to. I think our problem might be different. 
 
When I do a select * from sqlite_master; I get the same response.
 
i.e. Error: malformed database schema - near )
 
I am thinking the best thing might be to upgrade to the latest version of
sqlite3. All the same, I would like to know what has happened. I looked on
sqlite.org, but could not find a reference to any way or any tools I can use
to analyse my database file to see what is wrong.
 
Is there no such tool for sqlite3?
 
Cheers
Mark


  _  

From: Stephen Oberholtzer [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 09, 2008 10:39 AM
To: [EMAIL PROTECTED]; General Discussion of SQLite Database
Subject: Re: [sqlite] Error: malformed database schema - near )



On Fri, Aug 8, 2008 at 5:21 PM, Mark Easton [EMAIL PROTECTED] wrote:


Hi,

We are using SQLite version 3.3.8 on Debian linux. Every now and again we
are getting corrupted databases. We suspect it is because the computer is
being turned off mid database operation.

We have given full permissions to the folder the database is in and to the
database itself.

The most important question - is how can I recover this database? When I
type in  pragama integrity_check it still returns the error Error:
malformed database schema - near ).


I seem to recall someone else having a similar problem, once.

Can you open the database and do select * from sqlite_master;, then sanity
check the sql column for syntax errors?

Several months ago, someone had managed to create a bunch of tables with an
extra , at the end due to a parser bug, and when they upgraded the new
parser rejected the old schema's SQL.


-- 
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Error: malformed database schema - near )

2008-08-09 Thread Mark Easton
Hi,

We are using SQLite version 3.3.8 on Debian linux. Every now and again we
are getting corrupted databases. We suspect it is because the computer is
being turned off mid database operation. 

We have given full permissions to the folder the database is in and to the
database itself.

The most important question - is how can I recover this database? When I
type in  pragama integrity_check it still returns the error Error:
malformed database schema - near ).

The second question is what can I do to prevent this problem occurring?

Many thanks for your help.
Mark

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Error: malformed database schema - near )

2008-08-09 Thread Kees Nuyt
On Sat, 9 Aug 2008 09:21:07 +1200, you wrote:

The second question is what can I do to prevent this problem occurring?

Is the database shared over NFS?
Do you use any dangerous PRAGMA, like PRAGMA synchronous =
OFF; ?
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Possible View bug

2008-08-09 Thread Shawn Wilsher
Hey all,

I think I managed to hit a bug with sqlite and views.  I try to insert
onto the view (I have a trigger setup to handle it), but sqlite gives
me the following error:
no such column: from_visit

Here is test file that demonstrates the bug:
http://files.shawnwilsher.com/2008/8/9/test-bug.c

Any advice?

Cheers,

Shawn Wilsher
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Possible View bug

2008-08-09 Thread Igor Tandetnik
Shawn Wilsher [EMAIL PROTECTED] wrote in
message news:[EMAIL PROTECTED]
 I think I managed to hit a bug with sqlite and views.  I try to insert
 onto the view (I have a trigger setup to handle it), but sqlite gives
 me the following error:
 no such column: from_visit

 Here is test file that demonstrates the bug:
 http://files.shawnwilsher.com/2008/8/9/test-bug.c

Your trigger uses a curious syntax for SQL INSERT statement, along the 
lines of

insert into tableName
values (columnName1 = value1, columnName2 = value2);

This is not a valid syntax. The correct way is

insert into tableName(columnName1, columnName2)
values (value1, value2);

Igor Tandetnik



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users