Re: [sqlite] Why we don't have strpos function?

2010-03-22 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Israel Lins Albuquerque wrote: > I have to talk with someone to add this function on the sqlite? Or this will > be tested and added later? SQLite is a library used in your apps. You can use the SQLite API to add or change whatever functions you

Re: [sqlite] Why we don't have strpos function?

2010-03-22 Thread Israel Lins Albuquerque
I have to talk with someone to add this function on the sqlite? Or this will be tested and added later? -- Atenciosamente, Israel Lins Albuquerque Desenvolvimento Polibrás Brasil Software Ltda. ___ sqlite-users mailing list

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jay A. Kreibich wrote: > I think you're actual question is if zero-characters are prohibited, > and I think the answer is no. SQLite quite happily works with strings with embedded nulls - it is also part of my test suite. SQLite has a count of

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
I fink now is all right: I follow your instructions and no more call to strlen are maked. And utf8 chars are ignored returning the correct char index when non blob, and if in text have any '\0' (only in blob fields i believe), this code will work too. Porwerfull test cases: -- with text

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Nicolas Williams
On Wed, Mar 17, 2010 at 03:02:59PM -0500, Jay A. Kreibich wrote: > On Wed, Mar 17, 2010 at 04:42:59PM -0300, Israel Lins Albuquerque scratched > on the wall: > > are you right the call to strpos("??", "??") are returning 5 and > > not 3 > > > > I'm looking for this... > > You can't

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Pavel Ivanov
>  I think you're actual question is if zero-characters are prohibited, >  and I think the answer is no. Yes, that was exactly my question. >  In any event, you can use >  sqlite3_value_bytes() to find out the length of the text value >  returned.  That is, however BYTES, not CHARACTERS. Oh,

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Jay A. Kreibich
On Wed, Mar 17, 2010 at 04:36:02PM -0400, Pavel Ivanov scratched on the wall: > > ?You can't do pointer math with values returned by strlen(). > > BTW, I see that SQLite has sqlite3_value_text() function but has no > sqlite3_value_text_len() function. Is it explicitly mentioned > somewhere that

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Pavel Ivanov
>  You can't do pointer math with values returned by strlen(). BTW, I see that SQLite has sqlite3_value_text() function but has no sqlite3_value_text_len() function. Is it explicitly mentioned somewhere that '\0' bytes in the middle of the text are prohibited? It seems that sqlite3_bind_text()

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Jay A. Kreibich
On Wed, Mar 17, 2010 at 04:42:59PM -0300, Israel Lins Albuquerque scratched on the wall: > are you right the call to strpos("??", "??") are returning 5 and not > 3 > > I'm looking for this... You can't do pointer math with values returned by strlen(). -j -- Jay A. Kreibich <

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
are you right the call to strpos("áéíóú", "í") are returning 5 and not 3 I'm looking for this... -- Atenciosamente, Israel Lins Albuquerque Desenvolvimento Polibrás Brasil Software Ltda. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
uarta-feira, 17 de Março de 2010 15:19:43 Assunto: Re: [sqlite] Why we don't have strpos function? On Wed, Mar 17, 2010 at 01:15:35PM -0300, Israel Lins Albuquerque scratched on the wall: > There are the patch: Which seems to assume one character equals one byte. -j -- Jay A. Kreibich

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Jay A. Kreibich
On Wed, Mar 17, 2010 at 01:15:35PM -0300, Israel Lins Albuquerque scratched on the wall: > There are the patch: Which seems to assume one character equals one byte. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
ite Database" <sqlite-users@sqlite.org> Enviadas: Quarta-feira, 17 de Março de 2010 12:08:56 Assunto: Re: [sqlite] Why we don't have strpos function? I forgot attach... This are based in the current release 3.6.23. -- Atenciosamente, Israel Lins

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
I forgot attach... This are based in the current release 3.6.23. -- Atenciosamente, Israel Lins Albuquerque Desenvolvimento Polibrás Brasil Software Ltda. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
ro - Mensagem original - De: "Simon Slavin" <slav...@bigfraud.org> Para: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> Enviadas: Quarta-feira, 17 de Março de 2010 11:05:04 Assunto: Re: [sqlite] Why we don't have strpos function?

Re: [sqlite] Why we don't have strpos function?

2010-03-17 Thread Simon Slavin
Strings are 16-bit strings which may or may not be Unicode strings, I think. It's hard to work out the position in a string if you don't know what encoding you're using. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org

[sqlite] Why we don't have strpos function?

2010-03-17 Thread Israel Lins Albuquerque
... -- Atenciosamente, Israel Lins Albuquerque Desenvolvimento Polibrás Brasil Software Ltda. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users