[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: SQLite and SELECT WHERE local_relpath LIKE

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Fri, 29 Oct 2010 12:51:24 +0100

Daniel Shahaf <d.s_at_daniel.shahaf.name> writes:

> Philip Martin wrote on Fri, Oct 29, 2010 at 08:58:02 +0100:
>> Can we treat the string as a bytes and just increment and carry?
>
> No, this might invalidate the UTF-8 sequence. If a character spans
> multiple bytes, then those bytes have header bits of the form /^1+0/
> (in regex), so incrementing the byte blindly will eventually invalidate
> the byte sequence by turning the 0 into a 1.

It turns out we don't need a general "next character", just the next
character after '/', i.e. '0'. Thus

  local_relpath LIKE 'foo/bar/%' ESCAPE '%'

becomes

  local_relpath > 'foo/bar/' AND local_relpath < 'foo/bar0'

-- 
Philip
Received on 2010-10-29 13:52:06 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.