Re: dollar quoting
От | Michael Paesold |
---|---|
Тема | Re: dollar quoting |
Дата | |
Msg-id | 4522C47C.4050607@gmx.at обсуждение исходный текст |
Ответ на | Re: dollar quoting (Jure Koren <jure@hehe.si>) |
Список | pgsql-jdbc |
Jure Koren wrote: > On Tuesday 03 October 2006 21:38, Jure Koren wrote: >> This is the version that I think addresses most of the concerns posted. > > Except for the empty ($$) tag, which this, hopefully last version, does as > well. Some more comments: - I don't think the regular expression is quite there yet, look at the code in the other patch -- the "c > 127" part - Having said that, I don't believe in compiling a regular expression for each dollar-quoted string and each $ character that is not part of a dollar quote - There must be something wrong with this line at the end of a dollar-quote: i = nextpos + tag.length() + 2; My other patch has this here: i += dollarQuoteTag.length() - 1; "nextpos" in the first case should be the same as "i" in the second case. Something like ..$$String$$; SELECT ... will break here, I guess. My patch included JUnit tests to detect such off-by-one-or-more errors. You could use them. I am now wondering which version has the better performance... especially I would like to know if switching between scanning the char[] and the original query string in this patch has any negative impact. If not, it could be applied quite easily to the other one. Perhaps you could evaluate both versions for performance? Best Regards, Michael Paesold
В списке pgsql-jdbc по дате отправления: