Friday, November 17, 2017

Re: dbext: sql not executed

Hello Wietse.

Thanks for reaching out.

On Fri, Nov 17, 2017 at 8:16 AM, wietse <wietse.j@gmail.com> wrote:

I'm having trouble getting `dbext` to work. I installed dbext_2500 from https://vim.sourceforge.io/scripts/script.php?script_id=356.

My vim version:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct  5 2017 04:42:50)
MacOS X (unix) version
Included patches: 1-1175
Compiled by travis@Traviss-Mac-592.local
Huge version with MacVim GUI.


 
let g:dbext_default_profile_mariadb_local='type=MYSQL:user=root:passwd=therealpassword:dbname=mydbname:host=127.0.0.1:port=3306'

I've done `:DBSetOption display_cmd_line=1`. When I execute SQL script in vim with this profile, e.g. by doing <leader>slt, I always get:

Connection: T(MYSQL)  H(127.0.0.1)  P(3306)  D(mvne_local)  U(root)   at 11:49
Last command:
mysql  -u root -ptherealpassword -h 127.0.0.1 -P 3306 -D mydbname -t < /var/folders/1p/wx9146md1_l6d204b6bhv_rm0000gn/T/vrGam1h/dbext.sql
Last SQL:
show tables like '%';
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql  Ver 14.14 Distrib 5.7.19, for osx10.11 (x86_64) using  EditLine wrapper
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Usage: mysql [OPTIONS] [database]
  -?, --help          Display this help and exit.
  -I, --help          Synonym for -?
[and the rest of the usage message from mysql...]

When I copy the cmd and execute it in bash I get the correct result:

>> mysql  -u root -ptherealpassword -h 127.0.0.1 -P 3306 -D mydbname -t < /var/folders/1p/wx9146md1_l6d204b6bhv_rm0000gn/T/vrGam1h/dbext.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
+--------------------------+
| Tables_in_mydbname (%) |
+--------------------------+


Looks like you have done an excellent job debugging through this.

I am hoping 26.00 will correct the issue, since I believe it is related to how the plugin uses Vim's job / channel support that has lead to the problem.

You can test this by trying your usual <Leader>slt, getting the error, then running:
:let b:dbext_job_enable=0
<Leader>slt

Which tells this buffer not to use the job / channel feature of Vim and execute it directly (as it did before Vim 8.0).

So try this first, then please upgrade to 26.00 and see if the whole issue is resolved.


Thanks,
David

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: