Skip to content

Possible regression #8

@bk322

Description

@bk322

I get an out of memory error on master, but the same script works on the same data using regex_replace build with commit of 2020-Nov-18: https://github.com/gwenn/sqlite-regex-replace-ext/tree/458fe6978349b503095ed7a5ecf637f0b0ec4d38

Here's a minimal working example:
out-of-memory.zip

It contains:

data.csv
libSqlite3Icu.so
libSqlite3IcuReplace-458fe6978349b503095ed7a5ecf637f0b0ec4d38.so
libSqlite3IcuReplace-master.so
script-458fe6978349b503095ed7a5ecf637f0b0ec4d38.sql
script-master.sql

When I run

sqlite3 < script-458fe6978349b503095ed7a5ecf637f0b0ec4d38.sql 

it works, when I run

sqlite3 < script-master.sql

it gives out of memory error:

screencast

The two sql scripts differ only with the regex_replace extension:

-- -*- mode: sql -*-

.load ./libSqlite3Icu.so

-- https://github.com/gwenn/sqlite-regex-replace-ext/tree/master - gives out of memory:
.load ./libSqlite3IcuReplace-master.so

.mode      csv
.separator ',' "\n"
.header    on

.import data.csv data

select
  case regex_replace(' \(.+', "column", '')
    when 'foo' then 'bar'
    else ''
  end as "column no comments"
from data
;

Both scripts run on the latest sqlite (3.35.4), I think regression is introduced by the February commits to this repo:
https://github.com/gwenn/sqlite-regex-replace-ext/commits/master

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions