Skip to content

Commit 108502a

Browse files
bagyi0vim-scripts
authored andcommitted
Version 11.01
Post by David Fishburn Bug Fixes --------- - If a large result set is retrieved, there is a significant performance delay which was introduced in 11.00. This was related to the new g:dbext_rows_affected feature (Tocer). - Error E15: Invalid expression: b:dbext_sqlvar_mv[var] is reported if you are using saved variables and then modified the query with a new variable. Now the saved variables are used for the known variables and you are prompted for the unknown.
1 parent a3efda9 commit 108502a

File tree

4 files changed

+37
-16
lines changed

4 files changed

+37
-16
lines changed

autoload/dbext.vim

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
" dbext.vim - Commn Database Utility
22
" Copyright (C) 2002-7, Peter Bagyinszki, David Fishburn
33
" ---------------------------------------------------------------
4-
" Version: 11.00
4+
" Version: 11.01
55
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
66
" Authors: Peter Bagyinszki <petike1 at dpg dot hu>
77
" David Fishburn <dfishburn dot vim at gmail dot com>
8-
" Last Modified: 2009 Aug 16
8+
" Last Modified: 2009 Aug 27
99
" Based On: sqlplus.vim (author: Jamis Buck)
1010
" Created: 2002-05-24
1111
" Homepage: http://vim.sourceforge.net/script.php?script_id=356
@@ -37,7 +37,7 @@ if v:version < 700
3737
echomsg "dbext: Version 4.00 or higher requires Vim7. Version 3.50 can stil be used with Vim6."
3838
finish
3939
endif
40-
let g:loaded_dbext_auto = 1100
40+
let g:loaded_dbext_auto = 1101
4141

4242
" call confirm("Loaded dbext autoload", "&Ok")
4343
" Script variable defaults, these are used internal and are never displayed
@@ -6049,10 +6049,6 @@ function! s:DB_runCmd(cmd, sql, result)
60496049
endif
60506050

60516051
call s:DB_addToResultBuffer(result, "add")
6052-
" Determine rows affected
6053-
if l:db_type !~ '\<DBI\>\|\<ODBC\>'
6054-
call s:DB_{l:db_type}_stripHeaderFooter(result)
6055-
endif
60566052

60576053
let dbi_result = 0
60586054
if exists("g:dbext_dbi_result")
@@ -6089,6 +6085,10 @@ function! s:DB_runCmd(cmd, sql, result)
60896085
endif
60906086
endif
60916087
if s:DB_get('autoclose') == '1' && s:dbext_result_count <= s:DB_get('autoclose_min_lines')
6088+
" Determine rows affected
6089+
if l:db_type !~ '\<DBI\>\|\<ODBC\>'
6090+
call s:DB_{l:db_type}_stripHeaderFooter(result)
6091+
endif
60926092
if s:dbext_result_count >= 2
60936093
if getline(2) !~ '^SQLCode:'
60946094
call dbext#DB_windowClose(s:DB_resBufName())
@@ -6503,8 +6503,16 @@ function! s:DB_addToResultBuffer(output, do_clear)
65036503
let cmd = "perl db_print_results('".dbi_orient."')"
65046504
exec cmd
65056505
else
6506+
let g:dbext_rows_affected = 0
6507+
let l:start_of_output = line('$')
65066508
silent! exec "put = a:output"
6509+
let l:end_of_output = line('$')
6510+
" Temporarily set this value as a rough estimate
6511+
" (with low cost) to be refined in DB_runCmd
6512+
" if the autoclose kicks in.
6513+
let g:dbext_rows_affected = l:end_of_output - l:start_of_output
65076514
endif
6515+
65086516
endif
65096517

65106518
" Since this is a small window, remove any blanks lines
@@ -6639,7 +6647,7 @@ function! s:DB_searchReplace(str, exp_find_str, exp_get_value, count_matches)
66396647
endif
66406648
endif
66416649

6642-
if use_save_vars == 1
6650+
if use_save_vars == 1 && has_key(b:dbext_sqlvar_mv, var)
66436651
let var_val = b:dbext_sqlvar_mv[var]
66446652
else
66456653
" Prompt the user using the name of the variable

autoload/dbext_dbi.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
" It adds transaction support and the ability
55
" to reach any database currently supported
66
" by Perl and DBI.
7-
" Version: 11.00
7+
" Version: 11.01
88
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
99
" Authors: David Fishburn <dfishburn dot vim at gmail dot com>
10-
" Last Modified: 2009 Aug 06
10+
" Last Modified: 2009 Aug 27
1111
" Created: 2007-05-24
1212
" Homepage: http://vim.sourceforge.net/script.php?script_id=356
1313
"
@@ -114,7 +114,7 @@ if !has('perl')
114114
let g:loaded_dbext_dbi_msg = 'Vim does not have perl support enabled'
115115
finish
116116
endif
117-
let g:loaded_dbext_dbi = 1100
117+
let g:loaded_dbext_dbi = 1101
118118

119119
if !exists("dbext_dbi_debug")
120120
let g:dbext_dbi_debug = 0

doc/dbext.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*dbext.txt* For Vim version 7.0. Last change: 2009 Aug 22
1+
*dbext.txt* For Vim version 7.0. Last change: 2009 Aug 27
22

33

44
VIM REFERENCE MANUAL
@@ -7,7 +7,7 @@
77
Peter Bagyinszki <petike1 at dpg dot hu>
88

99
Database extension plugin (dbext.vim) manual
10-
dbext.vim version 11.00
10+
dbext.vim version 11.01
1111

1212
For instructions on installing this file, type
1313
:help add-local-help
@@ -92,6 +92,19 @@ David Fishburn
9292
==============================================================================
9393
2. What's New *dbext-new*
9494

95+
Version 11.01
96+
97+
Bug Fixes
98+
---------
99+
- If a large result set is retrieved, there is a signficant performance
100+
delay which was introduced in 11.00. This was related to the new
101+
g:dbext_rows_affected feature (Tocer).
102+
- Error E15: Invalid expression: b:dbext_sqlvar_mv[var] is reported if
103+
you are using saved variables and then modified the query with a new
104+
variable. Now the saved variables are used for the known variables
105+
and you are prompted for the unknown.
106+
107+
95108
Version 11.00
96109

97110
New Features

plugin/dbext.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
" dbext.vim - Commn Database Utility
22
" Copyright (C) 2002-7, Peter Bagyinszki, David Fishburn
33
" ---------------------------------------------------------------
4-
" Version: 11.00
4+
" Version: 11.01
55
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
66
" Authors: Peter Bagyinszki <petike1 at dpg dot hu>
77
" David Fishburn <dfishburn dot vim at gmail dot com>
8-
" Last Modified: 2009 Aug 16
8+
" Last Modified: 2009 Aug 27
99
" Based On: sqlplus.vim (author: Jamis Buck)
1010
" Created: 2002-05-24
1111
" Homepage: http://vim.sourceforge.net/script.php?script_id=356
@@ -38,7 +38,7 @@ if v:version < 700
3838
echomsg "dbext: Version 4.00 or higher requires Vim7. Version 3.50 can stil be used with Vim6."
3939
finish
4040
endif
41-
let g:loaded_dbext = 1100
41+
let g:loaded_dbext = 1101
4242

4343
if !exists('g:dbext_default_menu_mode')
4444
let g:dbext_default_menu_mode = 3

0 commit comments

Comments
 (0)