[sqlite] How many table can i create in a db?

2007-07-20 Thread Allen . Zhang
I open one db,then create table.
How many table can i create?
10,100?
what is the max table num in one db?

BR
allen.zhang

Re: [sqlite] realloc size smaller than malloc size?is it error in vc6?

2007-07-12 Thread Allen . Zhang
it is my fault.

I have read msdn again,copy the remarks 

The size argument gives the new size of the block, in bytes. The contents 
of the block are unchanged up to the shorter of the new and old sizes, 
although the new block can be in a different location. Because the new 
block can be in a new memory location, the pointer returned by realloc is 
not guaranteed to be the pointer passed through the memblock argument.

that is sure the size is not limition.

thank a lot.





"Cory Nelson" <[EMAIL PROTECTED]> 
2007-07-12 16:00
Please respond to
sqlite-users@sqlite.org


To
sqlite-users@sqlite.org
cc

Subject
Re: [sqlite] realloc size smaller than malloc size?is it error in vc6?






On 7/12/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> in the os_common.h file there are
> 
sqlite3GenericMalloc,sqlite3GenericRealloc,sqlite3GenericFree,sqlite3GenericAllocationSize
> function.
> If I run the sqlite in windows,the sqlite3GenericRealloc function just
> call the realloc function.
> from the msdn and my test,the realloc(void *p, n)function,the realloc 
size
> must equel or bigger than the malloc size, or it will be corrupt.
>
> But when I trace the sqlite3_3_17, I find the realloc size sometimes can
> smaller than the original malloc size for the same memory pointer,I 
think
> this should be error.

realloc does not require size to be larger than the last alloc size.
if msdn says otherwise it is mistaken.  vc++ implements it correctly.

> But I still can get the right result by running the simple.
> Is it a problem?
>
> anybody trace the realloc function?
>
> Thanks in advance.
>
> BR
> allen.zhang
>
>
>
>
>


-- 
Cory Nelson

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




[sqlite] realloc size smaller than malloc size?is it error in vc6?

2007-07-12 Thread Allen . Zhang
in the os_common.h file there are 
sqlite3GenericMalloc,sqlite3GenericRealloc,sqlite3GenericFree,sqlite3GenericAllocationSize
 
function.
If I run the sqlite in windows,the sqlite3GenericRealloc function just 
call the realloc function.
from the msdn and my test,the realloc(void *p, n)function,the realloc size 
must equel or bigger than the malloc size, or it will be corrupt.

But when I trace the sqlite3_3_17, I find the realloc size sometimes can 
smaller than the original malloc size for the same memory pointer,I think 
this should be error.
But I still can get the right result by running the simple. 
Is it a problem?

anybody trace the realloc function?

Thanks in advance.

BR
allen.zhang






Re: [sqlite] create table error

2007-05-14 Thread allen . zhang
close it.
that is for my reason.
the relloc memory error!




"Mohd Radzi Ibrahim" <[EMAIL PROTECTED]> 
2007-05-10 16:44
Please respond to
sqlite-users@sqlite.org


To

cc

Subject
Re: [sqlite] create table error






Could it be that the data where *sql is pointing to is being re-used 
somewhere?


--radzi.

- Original Message - 
From: <[EMAIL PROTECTED]>
To: 
Sent: Thursday, May 10, 2007 3:54 PM
Subject: [sqlite] create table error


> the following is my test code. just create table.
>
>
> rc = sqlite3_open("zieckey.db", );
> char *sql = " CREATE TABLE SensorData(ID INTEGER PRIMARY KEY,SensorID
> INTEGER,SiteNum INTEGER,Time VARCHAR(12),SensorParameter REAL);" ;
> sqlite3_exec( db , sql , 0 , 0 ,  );
> sqlite3_close(db);
>
>
>
> when execute the sqlite3_exec function,
>
> it corrupt at line 189, sqlite3StrICmp(pTab->aCol[j].zName,
> pChanges->a[i].zName)==0 )
>
> pChanges->a[i].zName is NULL;
>
> anybody know the reason ?
>
>
> how to trace the error? there is no clue for me to analyze the error.
>
> thanks a lot
>
> allen.zhang
> 



-
To unsubscribe, send email to [EMAIL PROTECTED]
-




Re: [sqlite] porting sqlite3 to embeded os-----lock question

2007-05-14 Thread allen . zhang
thank you for your reply.
I have make it run on our embeded os and make some simple tests. it runs 
ok.
great!!





"Nuno Lucas" <[EMAIL PROTECTED]> 
2007-05-12 07:03
Please respond to
sqlite-users@sqlite.org


To
sqlite-users@sqlite.org
cc

Subject
Re: [sqlite] porting sqlite3 to embeded os-lock question






On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 
wrote:
> I am porting sqlite3 to the embeded os,such as threadx,nucleus,ect..
> I am writing the file such as os_threadx.c,os_nucleus.c according to the
> os_win.c,os_unix.c.
> I have read the os_win.c and find that there is a switcher OS_WINCE in 
the
> struct winFile.
> Is this mean the windows platform don't need the function such as share
> memory(CreateFileMappingW,MapViewOfFile) inside the OS_WINCE 
swither?

The shared memory is needed on WinCE to implement the LockFile
functions (which don't exist on WinCE).
If you don't need to do locking (because only your app will access the
db), you don't need the shared memory thing.

>
> whether I should realize the share memory lock function in the embeded 
os?
> I have find there is not a direct way similar to the windows share 
memory
> and the interface funcitons.
> It seems difficult to simulate the share memory funciton and it's lock
> function in my embeded os.
> Does it mean I must realize it. or the porting will fail.

It's up to you to know what level of compatibility you need. I would
guess that for you embedded os you don't need the locking part, so can
safely replace it with dummy functions that always succeed.

>
> another question:
> There is also a little difficult to realize the
> sqlite3WinThreadSpecificData function to get the thread information,
> Is this also must realize ?

If you use threads, then that would depend on your use of sqlite.


Regards,
~Nuno Lucas

>
> thanks a lot.
> allen.zhang
>
>

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




[sqlite] create table error

2007-05-10 Thread allen . zhang
the following is my test code. just create table.


 rc = sqlite3_open("zieckey.db", ); 
 char *sql = " CREATE TABLE SensorData(ID INTEGER PRIMARY KEY,SensorID 
INTEGER,SiteNum INTEGER,Time VARCHAR(12),SensorParameter REAL);" ;
 sqlite3_exec( db , sql , 0 , 0 ,  );
 sqlite3_close(db); 



when execute the sqlite3_exec function,

it corrupt at line 189, sqlite3StrICmp(pTab->aCol[j].zName, 
pChanges->a[i].zName)==0 )

pChanges->a[i].zName is NULL;

anybody know the reason ?


how to trace the error? there is no clue for me to analyze the error.

thanks a lot

allen.zhang


[sqlite] porting sqlite3 to embeded os-----lock question

2007-05-09 Thread allen . zhang
I am porting sqlite3 to the embeded os,such as threadx,nucleus,ect..
I am writing the file such as os_threadx.c,os_nucleus.c according to the 
os_win.c,os_unix.c.
I have read the os_win.c and find that there is a switcher OS_WINCE in the 
struct winFile.
Is this mean the windows platform don't need the function such as share 
memory(CreateFileMappingW,MapViewOfFile) inside the OS_WINCE swither?

whether I should realize the share memory lock function in the embeded os? 
I have find there is not a direct way similar to the windows share memory 
and the interface funcitons.
It seems difficult to simulate the share memory funciton and it's lock 
function in my embeded os.
Does it mean I must realize it. or the porting will fail.

another question:
There is also a little difficult to realize the 
sqlite3WinThreadSpecificData function to get the thread information, 
Is this also must realize ?

thanks a lot.
allen.zhang



Re: [sqlite] how to compile sqlite3 in ads1.2 environment?

2007-04-25 Thread allen . zhang
arm developer suite v1.2
support arm7,arm9




Joe Wilson <[EMAIL PROTECTED]> 
2007-04-26 11:03
Please respond to
sqlite-users@sqlite.org


To
sqlite-users@sqlite.org
cc

Subject
Re: [sqlite] how to compile sqlite3 in ads1.2 environment?






What's an ads1.2?

--- [EMAIL PROTECTED] wrote:
> Dose anybody compile the sqlite3 in the ads1.2 environment?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-




[sqlite] lemon compile parse.y error for windows

2007-04-25 Thread allen . zhang
I compile the lemon.c in vc6 environment. (build it the win32 console 
application )

then I use the command

lemon parse.y 

I successfully get the parse.h file

but the file is not right. 
I only get 137 ids

the follwing 15 ids do not exist in the parse.h

TK_TO_TEXT
 TK_TO_BLOB 
 TK_TO_NUMERIC 
TK_TO_INT 
TK_TO_REAL 
TK_END_OF_FILE 
TK_ILLEGAL 
TK_SPACE 
TK_UNCLOSED_STRING 
TK_COMMENT 
TK_FUNCTION 
TK_COLUMN 
TK_AGG_FUNCTION 
TK_AGG_COLUMN 
TK_CONST_FUNC 

anybody konw the reason?

Thank you!


[sqlite] how to compile sqlite3 in ads1.2 environment?

2007-04-25 Thread allen . zhang
Dose anybody compile the sqlite3 in the ads1.2 environment?