Subject: bug#6686: 24.0.50; [restore functionality] sql-mode

From: Michael Mauger <[email-masked]>
Date: Wed, 28 Jul 2010 12:52:12 -0700 (PDT)

----- Original Message ----

> From: Chong Yidong <[email-masked]>
> To: Michael R. Mauger <[email-masked]>
> Cc: Tim Cross <[email-masked]>; [email-masked]
> Sent: Fri, July 23, 2010 12:19:14 PM
> Subject: Re: bug#6686: 24.0.50; [restore functionality] sql-mode
> 
> Hi Michael,
> 
> Could you take a look at this bug report?   Thanks.
> 
> 
> Tim Cross <[email-masked]> writes:
> 
> >  The way sql-mode works in emacs has changed and while some of the
> >  changes are good, there is one major change that isn't.
> >
> > In  previous versions of sql-mode, running queries and executing stored
> >  procedures/functions from within the sql interactive buffer did not hold
> >  system focus. If the command you executed was going to take some time to
> >  run, you could switch to another buffer/frame and continue working, read
> >  mail, use w3m etc. However, this has now changed. When you execute an
> >  SQL command or call a stored procedure/function from within the SQLi
> >  buffer, you are effectively locked out from doing anything else in emacs
> >  until that command has completed. I'm guessing, but suspect this change
> >  is due to the additional output processing that has been added to
> >  sql-mode, such as translation of tabs to spaces etc. I have disabled as
> >  many features as I can, but this has made no difference.
> >
> > I am  using sql-mode to access an Oracle database using sqlplus.
> > Everything  works as it always has with emacs 23 and this change only
> > occured in  emacs 24 either late last year or early this year.
> >
> > Could we  either have the old behavior restored or if that is not
> > possible and if  the change is due to other new features, have a way of
> > turning the new  features off and restoring the old behavior. I really
> > want to continue  using sql-mode and *really* don't want to have to give
> > it up in favor of  something far less pleasant to use than emacs!
> >
> >  thanks,
> >
> > Tim
> >
> >
> > In GNU Emacs 24.0.50.1  (i686-pc-linux-gnu, GTK+ Version 2.20.1)
> >  of 2010-07-19 on  blind-mole
> > Windowing system distributor `The X.Org Foundation', version  11.0.10706000
> > configured using `configure   '--prefix=/usr/local''
>

The only change that I believe impacted the handling of the command interaction 
in SQLi mode 

is the use of `comint-input-sender' which may modify the text sent to the 
command interpreter
before sending it.  (For example, replacing TAB characters or handling 
&placeholders).  This 

should not cause the blocking behavior you describe.

I have seen that behavior with code found on the net that strips out 
continuation prompts on 

SQL*Plus.  Is that a possible culprit?  

To be sure that the input filtering is not the cause you can:

  (sql-set-product-feature 'oracle :input-filter nil)

The other thing you can try is to interrupt emacs under the debugger when its 
blocking and
look at the backtrace.  

Beyond that, more details of your setup of SQL mode might be helpful.  I'm not 
seeing the same 

behavior but I don't have sqlplus available to me now.