Raymond Irving wrote:

Hello Everyone,

I've download sqlite 3.0.8 and opened a database to
try the PRAGMA short_column_names feature but it did
not work. It only returned blank column names.

Any ideas or fixed?

Here's the result from the sqlite3 console with
.headers on:

sqlite> pragma short_column_names = on
  ...> go
sqlite> select t1.*,t2.* from customers t1, orders t2
limit 1
  ...> go
||||||||||||||||||||||||
ALFKI|Alfreds Futterkiste|Maria Anders|Sales
Representative|Obere Str. 57|Berlin
||12209|Germany|030-0074321|030-0076545|10330|LILAS|3|16-Nov-1994|14-Dec-1994|28
-Nov-1994|1|12.75|LILA-Supermercado|Carrera 52 con
Ave. Bol¦§¢®var #65-98 Llano La
rgo|Barquisimeto|Lara|3508|Venezuela


__
Raymond Irving


I was under the impression this had been fixed in 3.x, and I'm rather disappointed to find that it's not. I guess that for backwards compatibility reasons, this wasn't changed? But even then, at least we
could fix the pragma so that those of us who want better compatibility with other dbs can have it.
To fix the pragma, there is a very simple patch. It works for both 2.x and 3.x, I've attached it
below. Can we have this committed?


John




diff -NU3 -r ./select.c ../../sqlite-orig/src/select.c --- ./select.c 2004-06-19 11:31:48.778990400 -0600 +++ ../../sqlite-orig/src/select.c 2004-06-17 13:03:38.000000000 -0600 @@ -739,7 +739,7 @@ sqlite3SetString(&zName, zTab, ".", zCol, 0); sqlite3VdbeSetColName(v, i, zName, P3_DYNAMIC); }else{ - sqlite3VdbeSetColName(v, i, zCol, 0); + sqlite3VdbeSetColName(v, i, zCol, P3_STATIC); } }else if( p->span.z && p->span.z[0] ){ sqlite3VdbeSetColName(v, i, p->span.z, p->span.n);



Reply via email to