On 05 Jun 2007 13:35:33 +0200, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
I'v read in change log that some stack allocted memory were moved to the heap, 
but I think that there is still to much allocated memory on the stack.
After creating a table with 2000 columns, jdbc driver created a query that run 
out of stack. Default java's stack limit is low, but it wasn't hard to create 
simillar query that crashed C application with default stack limit. And the 
fact that it crashed instead repoting an error isn't really nice.
The query created by the driver looks like that:

select null as TABLE_CAT, null as TABLE_SCHEM, 'test' as TABLE_NAME, cn as 
COLUMN_NAME, dt as DATA_TYPE, tn as TYPE_NAME, 2000000000 as COLUMN_SIZE, 
2000000000 as BUFFER_LENGTH, 10   as DECIMAL_DIGITS, 10   as NUM_PREC_RADIX, 
colnullable as NULLABLE, null as REMARKS, null as COLUMN_DEF, 0    as 
SQL_DATA_TYPE, 0    as SQL_DATETIME_SUB, 2000000000 as CHAR_OCTET_LENGTH, 
ordpos as ORDINAL_POSITION, (case colnullable when 0 then 'N' when 1 then 'Y' 
else '' end)    as IS_NULLABLE, null as SCOPE_CATLOG, null as SCOPE_SCHEMA, 
null as SCOPE_TABLE, null as SOURCE_DATA_TYPE from (select 0 as ordpos, 1 as 
colnullable, 'col1' as cn, 'double' as tn, 8 as dt union all select 1 as 
ordpos, 1 as colnullable, 'col2' as cn, 'double' as tn, 8 as dt union all 
select 2 as ordpos, 1 as colnullable, 'col3' as cn, 'double' as tn, 8 as dt 
union all select 3 as ordpos, 1 as colnullable, 'col4' as cn, 'double' as tn, 8 
as dt union all select 4 as ordpos, 1 as colnullable, 'lastcol' as cn, 'double' 
as tn, 8 as dt);

but uses more columns.

Are you sure it is sqlite that used the stack and not the jdbc driver
(or your application)?
What happens if you run that query from the sqlite shell?

The reason I ask is because I used sqlite on WinCE (but not currently)
and only 1 time I had problem with stack usage (a version that made
sqlite use the stack instead of the heap, but got corrected right away
in the next version).

I'm sure a lot of sqlite users in the embedded field would be
"ranting" about sqlite stack usage if that was true.


Regards,
~Nuno Lucas

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

Reply via email to