[sqlite] sqlite3 ltrim behaviour bug or feature?

2011-01-16 Thread thilo
Thanks Martin,

Maybe the documentation could be extended:

The ltrim(X,Y) function returns a string formed by removing any and all
characters that appear in Y from the left side of X. If the Y argument
is omitted, ltrim(X) removes spaces from the left side of X. 

to:

The ltrim(X,Y) function returns a string formed by removing any and all
characters that appear in Y from the left side of X. If the Y argument
is omitted, ltrim(X) removes spaces from the left side of X.
Similar to the regexp   X ~ s/^[Y]*//g.


Sorry for the noise
thilo





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


[sqlite] sqlite3 ltrim behaviour bug or feature?

2011-01-14 Thread Thilo Jeremias
Hi,
the following seems wrong to me:

bash-4.0# sqlite3
SQLite version 3.6.14.2
Enter .help for instructions
Enter SQL statements terminated with a ;


sqlite select ltrim(12300567,1230);
567
sqlite select ltrim(012300567,0123);
567
sqlite select ltrim(12300567,123);
00567
sqlite


Is the stripping of leading 0's intentional?
(or a bug in my netbsd port?)

How can I workaround this problem?


cheers thilo


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


Re: [sqlite] sqlite3 ltrim behaviour bug or feature?

2011-01-14 Thread Martin.Engelschalk
Hi,

this is the expected behaviour.

See http://www.sqlite.org/lang_corefunc.html

The ltrim(X,Y) function returns a string formed by removing any and all 
characters that appear in Y from the left side of X. If the Y argument 
is omitted, ltrim(X) removes spaces from the left side of X. 

The second argument is not a string but a set of characters. ltrim() 
strips leading zeros if you include a zero anywhere in your second 
argunent. This is the case in the first two examples.

Martin

Am 13.01.2011 14:41, schrieb Thilo Jeremias:
 Hi,
 the following seems wrong to me:

 bash-4.0# sqlite3
 SQLite version 3.6.14.2
 Enter .help for instructions
 Enter SQL statements terminated with a ;


 sqlite  select ltrim(12300567,1230);
 567
 sqlite  select ltrim(012300567,0123);
 567
 sqlite  select ltrim(12300567,123);
 00567
 sqlite


 Is the stripping of leading 0's intentional?
 (or a bug in my netbsd port?)

 How can I workaround this problem?


 cheers thilo


 ___
 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