Hi,

my ARM7 is a LPC2478. It runs with 16MB RAM. OS is selfmade, consists of
TNKernel, Microwindows-Nano-X, FLTK, Elm-Chans FAT-FS, lwIP. Compiler ist
arm-elf-gcc 4.3.3. Application is linked against newlib-1.17.0. 
The SQLite test program:

#include <stdio.h>
#include "sqlite3.h"

static int callback(void *NotUsed, int argc, char **argv, char **azColName){
  int i;
  for(i=0; i<argc; i++){
    printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
  }
  printf("\n");
  return 0;
}

int sqtest (void) {
  sqlite3 *db;
  char *zErrMsg = 0;
  int rc;

  rc = sqlite3_open("database_file.db", &db);
  if( rc ){
    printf("Can't open database: %s\n", sqlite3_errmsg(db));
    sqlite3_close(db);
    return 1;
  }
  rc = sqlite3_exec(db, "select * from user", callback, 0, &zErrMsg);
  if( rc!=SQLITE_OK ){
    printf("SQL error: %s\n", zErrMsg);
    sqlite3_free(zErrMsg);
  }
  sqlite3_close(db);
  return 0;
}
Program's output is:
OPENX   16  /database_file.db 01002
OPEN    16  /database_file.db
READ    16    100       0 0
SQL error: database disk image is malformed
CLOSE   16 

Running on X86 the output is:
OPENX   3   c:\_work\ARM\src\sqlite-3.6.17/database_file.db 0100402
OPEN    3   c:\_work\ARM\src\sqlite-3.6.17/database_file.db
READ    3     100       0 0
READ    3    1024       0 0
READ    3      16      24 0
READ    3    1024    1024 0
name = Hans
nr = 1

name = karl
nr = 2

name = sepp
nr = 3

CLOSE   3

Regards, 
Gottfried




Shane Harrelson wrote:
> 
> I wasn't able to duplicate this with my ARM system.   Can you provide
> more details?  or was the issue DRH pointed out above your problem?
> 
> On Wed, Sep 9, 2009 at 7:02 AM, gprand <g20...@aon.at> wrote:
>>
>> Hi,
>>
>> I can confirm this behavoir. Now, after 2 days debugging and unsuccessful
>> searching around I have found your posting.  It drives me crazy, but I
>> can
>> not locate the problem. Exactly the same code works, compiled for X86,
>> and
>> fails, compiled for ARM. All machine depending configuration is omitted.
>>
>> My poor debugging results are:
>> * 100 Bytes be read from the file.
>> * SQLite attempts to parse the sql text
>> * SQLite creates sqlite_master table
>> * Now it attempts to parse the sql statement again
>> * Now SQLite crashes in ARM mode.
>>
>> In X86 mode 1024 bytes be read and all works fine.
>> Why?
>>
>> Gottfried
>>
>> Sorry for poor english.
>>
>>>Hi,
>>>I am using sqlite3.6.17 on arm_v7 . sqlite3_Exec fails giving the
following
>>>error sqlite3_exec  malformed database schema error : unrecognized token
>> "'".
>>>I am able to read the database manually using select commands. Executing
>> the
>>>same sqlite3_exec statements on x86 machine on the same db file does not
>>>give any error . Any help on this issue will be welcome,
>> --
>> View this message in context:
>> http://www.nabble.com/sqlite3_exec-fails-on-arm-tp25293839p25362643.html
>> Sent from the SQLite mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/sqlite3_exec-fails-on-arm-tp25293839p25377974.html
Sent from the SQLite mailing list archive at Nabble.com.

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

Reply via email to