Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-08 Thread petern
Hey Brian. I had some time this morning to look at it. Try whacking this new concat_replace into your SQLite build in either func.c or sqlite3.c amalgam. Also remember to hook it up with a new entry after say, group_concat, as follows. AGGREGATE(group_replace, 3, 0, 0,

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-07 Thread Jens Alfke
> On Aug 7, 2017, at 2:02 AM, Brian Clifford > wrote: > > I have looked into using a user defined function however it was very slow. It’s quite expensive to call from unmanaged (native) code into managed (C#/Java) code. If possible, write the user defined

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-07 Thread Brian Clifford
Thank Simon, I have looked into using a user defined function however it was very slow. I tried to create an expression index unfortunately I was not able as the function was seen as non deterministic. (I am using the C# interface and its not possible to define a user defined function as

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-03 Thread Brian Clifford
Thanks for looking into this, I see in the original example I passed in a nested call of 28 replaces() this was the cutoff point where it would fail, the following line has about 36 replaces() this fails for me: replace(replace(replace(replace(replace(replace(replace(replace(replace(

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-03 Thread Simon Slavin
On 3 Aug 2017, at 3:33pm, petern wrote: > The deeply nested string replace pattern comes up frequently. A > suggestion. Why not a built in aggregate replace function? Two more suggestions: Create a function which does exactly what you want. Call it

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-03 Thread petern
The deeply nested string replace pattern comes up frequently. A suggestion. Why not a built in aggregate replace function? As such, the example here would be more readable and not limited by stack depth as the expression: SELECT replace(Transcript,column1,column2) FROM (VALUES

Re: [sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-03 Thread Richard Hipp
I am unable to reproduce the problem. Do you have any additional hints on how to make this fail? The depth of the stack in the push-down automaton used by the parser is deliberately limited to 100 levels. This is a feature, not a bug. See https://www.sqlite.org/compile.html#yystackdepth for

[sqlite] Bug: Nested function call to replace() throws parser stack overflow exception

2017-08-03 Thread Brian Clifford
Hi, I've subscribed to the sqllite mailing list but am still awaiting authorization. I'd like to report a bug I found with sqlite where I'm creating a function index which consists of approx 36 nested calls to the replace() function (to remove punctuation) I get a parser stackoverflow exception