Potential "list index out of range" in FunctionTable SQLite Extension
The columns you can filter on are added as HIDDEN columns *after* the exported columns. So you would have:

```
table func: series(<start=0>, <stop=None>, <step=1>)

class Series(TableFunction):
    params = ['start', 'stop', 'step']
    columns = ['value']

...

CREATE VIRTUAL TABLE series(start, stop, step, value HIDDEN)
```

When looking up the constrained column, we subtract from it the number of "non-hidden" columns to get the index of the hidden/parameterized column.

I've added a check that this value does not drop below zero: 56fe72362a65199eb75bf25684eb290c57e3a37f Ah, ok.  So that line is only meant to apply to those hidden columns, which would only be the non-negative cases.  Thanks for the quick response and fix!
Hi,
I ran into an issue with this line in FunctionTable's pwBestIndex() function in _sqlite_ext.pyx:

```
        columns.append(table_func_cls.params[pConstraint.iColumn -
                                             table_func_cls._ncols])
```
The value of iColumn is some number less than _ncols, so the index into the list is always negative.  If it's _too_ negative, it goes past the start of params, causing an "IndexError: list index out of range" exception.

If you need some sample code demonstrating the problem, I'll put something together.

I'm happy to work on a fix and submit a pull request, but I'm having trouble figuring out the intended logic.  (I'm wondering why column positions are involved in indexing into the params list.  Although I do see that params are relevant here and in the filter step.)  Maybe it was partly to deal with the constraints of SQLite's virtual table API.  But anyway, if I can help at all, let me know.