SQL completion bug?

13 views
Skip to first unread message

Benjamin R. Haskell

unread,
Jan 7, 2010, 1:20:38 PM1/7/10
to Vim Users
[I think I may have short-circuited getting a response to the first
question in my original thread by self-replying to the second. Sorry
for the re-post, but this is biting me again.]

In vim 7.2, SQL completion fails on virtually any input with:

"Omni complete (^O^N^P) Pattern not found"

Looking into the function, I see
in /usr/share/vim/vim72/autoload/sqlcomplete.vim
in function sqlcomplete#Complete(findstart,base)

98 if a:findstart
99 " Locate the start of the item, including "."
100 let line = getline('.')
101 let start = col('.') - 1
102 let lastword = -1
103 let begindot = 0
104 " Check if the first character is a ".", for column completion
105 if line[start - 1] == '.'
106 let begindot = 1
107 endif
108 while start > 0
109 if line[start - 1] =~ '\(\w\|\s\+\)'
110 let start -= 1

If I change line 109's pattern from '\(\w\|\s\+\)' to '\w', completion
seems to work fine. I also noticed that I get completion if I'm in the
first column. So... what's that alternation *supposed* to catch?
(Looks like it's trying to catch table names with spaces in them, but
not looking for some kind of start quote.) Or is this a bug?

Best,
Ben

David Fishburn

unread,
Jan 7, 2010, 1:51:05 PM1/7/10
to vim...@googlegroups.com
On Thu, Jan 7, 2010 at 1:20 PM, Benjamin R. Haskell <v...@benizi.com> wrote:
> [I think I may have short-circuited getting a response to the first
> question in my original thread by self-replying to the second.  Sorry
> for the re-post, but this is biting me again.]
>
> In vim 7.2, SQL completion fails on virtually any input with:

I suspect you are using an older version of this than myself.

I am running this version:
autoload\sqlcomplete.vim
" Version: 7.0

Can you verify what version you are using.

The version 7.0 is available via CVS/SVN.

Dave

Benjamin R. Haskell

unread,
Jan 7, 2010, 2:17:06 PM1/7/10
to vim...@googlegroups.com

Hmm. Yes, I'm using an older version (6.0 included w/ vim 7.2.257).

AFAICT, though, Vim's own SVN still has that version (committed in
r1078), and I didn't see any mention of CVS/SVN on the various
vim.org/scripts pages (dbext/sqlcomplete), nor in the file itself... I
feel like I'm overlooking something...

Best,
Ben

David Fishburn

unread,
Jan 7, 2010, 4:25:40 PM1/7/10
to vim...@googlegroups.com
On Thu, Jan 7, 2010 at 2:17 PM, Benjamin R. Haskell <v...@benizi.com> wrote:
> On Thu, 7 Jan 2010, David Fishburn wrote:
>
>> On Thu, Jan 7, 2010 at 1:20 PM, Benjamin R. Haskell <v...@benizi.com> wrote:
>> > [I think I may have short-circuited getting a response to the first
>> > question in my original thread by self-replying to the second.  Sorry
>> > for the re-post, but this is biting me again.]
>> >
>> > In vim 7.2, SQL completion fails on virtually any input with:
>>
>> I suspect you are using an older version of this than myself.
>>
>> I am running this version:
>> autoload\sqlcomplete.vim
>> " Version:     7.0
>>
>> Can you verify what version you are using.
>>
>> The version 7.0 is available via CVS/SVN.
>
> Hmm.  Yes, I'm using an older version (6.0 included w/ vim 7.2.257).


I am glad the SQLComplete 7.0 solves the issues.

Please keep the reports coming, both bugs and suggestions, feedback is
always appreciated.

Dave

Reply all
Reply to author
Forward
0 new messages