unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* MySQL exits abnormally in Emacs
@ 2006-12-14 21:11 Corey Foote
  2006-12-15 18:16 ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Corey Foote @ 2006-12-14 21:11 UTC (permalink / raw)


Hello everyone,

I'm a newbie user to MySQL, and I'm trying to learn how to run an
interactive SQL session through Emacs. I'm using GNU Emacs 22.0 and
MySQL 5.0 under Windows XP.

After typing the following:

1. M-x sql-mysql
2. User: myusername RET
3. Password: mypassword RET
4. Database: mydatabase RET
5. Server: localhost RET

I type my query and press C-c C-c and get the following error:

select now();  C-c C-cnow()
2006-12-14 14:11:25

Process SQL exited abnormally with code 1

It gives the correct result, but the process "exits abnormally" and then
I can't type in any further queries without going through steps 1-5
again. It does not give me this problem when I'm using the terminal
window.

Also, nothing happens when I simply type my query and press RET. It
seems I have to type C-c C-c in order to get any results.

Any solutions you could offer would be most appreciated. I'd much
rather stay in Emacs to work with SQL, rather than having to jump back
and forth to the terminal window.

Thank you for your help,

Corey Foote
coreyfoote@hotmail.com

_________________________________________________________________
Share your latest news with your friends with the Windows Live Spaces 
friends module. 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: MySQL exits abnormally in Emacs
  2006-12-14 21:11 MySQL exits abnormally in Emacs Corey Foote
@ 2006-12-15 18:16 ` Juanma Barranquero
  2006-12-16  3:37   ` Corey Foote
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2006-12-15 18:16 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 12/14/06, Corey Foote <coreyfoote@hotmail.com> wrote:

> I type my query and press C-c C-c and get the following error:
>
> select now();  C-c C-cnow()
> 2006-12-14 14:11:25
>
> Process SQL exited abnormally with code 1

Where do you type C-c C-c? If it is in the process buffer (the one
where mysql is running), C-c C-c is bound to
`comint-interrupt-subjob', so it's no wonder that it gets interrupted.
In that buffer it's enough to press ENTER after queries:

select count(*) from mysql.user;
+----------+
| count(*) |
+----------+
|        5 |
+----------+

C-c C-c (`sql-send-paragraph') is used from a SQL buffer that you
associate with the inferior process (the subprocess) that is running
mysql.  For example, create a buffer in SQL mode (either setting it
with "M-x sql-mode" or visiting a .SQL file), and then do "M-x
sql-product-interactive", or choose the option "Start SQLi Session" in
the SQL menu.  That way you'll have a running mysql client in a buffer
associated with your SQL source buffer. Then you can write SQL code in
your source buffer and send it to the inferior process with C-c C-c.

Take a look at the file lisp/progmodes/sql.el.

                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: MySQL exits abnormally in Emacs
  2006-12-15 18:16 ` Juanma Barranquero
@ 2006-12-16  3:37   ` Corey Foote
  2006-12-16  3:42     ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Corey Foote @ 2006-12-16  3:37 UTC (permalink / raw)
  Cc: help-gnu-emacs

Thanks for your reply to my posting. However, I think I didn't explain
the problem I'm having well enough. Please allow me to try to describe it
more clearly.

When I type queries into the process buffer and press enter, no
results are returned until I interrupt the process with C-c C-c. Only
when the process is interrupted are any results returned. The results
off all queries are then returned together and without any boxes being
drawn around them. For example, if I type into the process buffer the
following:

select now();RET

select count(*) from mysql.user;RET

No results are returned until I type C-c C-c in the process buffer at
which point the results are returned all at once and without
formatting:

  C-c C-cnow()
2006-12-15 22:15:55
count(*)
5

Process SQL exited abnormally with code 1

It would be nice to be able to get the results I need without having
to terminate the process in order to see them.

Thanks again,

Corey Foote
coreyfoote@hotmail.com



>From: "Juanma Barranquero" <lekktu@gmail.com>
>To: "Corey Foote" <coreyfoote@hotmail.com>
>CC: help-gnu-emacs@gnu.org
>Subject: Re: MySQL exits abnormally in Emacs
>Date: Fri, 15 Dec 2006 19:16:55 +0100
>
>On 12/14/06, Corey Foote <coreyfoote@hotmail.com> wrote:
>
>>I type my query and press C-c C-c and get the following error:
>>
>>select now();  C-c C-cnow()
>>2006-12-14 14:11:25
>>
>>Process SQL exited abnormally with code 1
>
>Where do you type C-c C-c? If it is in the process buffer (the one
>where mysql is running), C-c C-c is bound to
>`comint-interrupt-subjob', so it's no wonder that it gets interrupted.
>In that buffer it's enough to press ENTER after queries:
>
>select count(*) from mysql.user;
>+----------+
>| count(*) |
>+----------+
>|        5 |
>+----------+
>
>C-c C-c (`sql-send-paragraph') is used from a SQL buffer that you
>associate with the inferior process (the subprocess) that is running
>mysql.  For example, create a buffer in SQL mode (either setting it
>with "M-x sql-mode" or visiting a .SQL file), and then do "M-x
>sql-product-interactive", or choose the option "Start SQLi Session" in
>the SQL menu.  That way you'll have a running mysql client in a buffer
>associated with your SQL source buffer. Then you can write SQL code in
>your source buffer and send it to the inferior process with C-c C-c.
>
>Take a look at the file lisp/progmodes/sql.el.
>
>                    /L/e/k/t/u

_________________________________________________________________
Get the latest Windows Live Messenger 8.1 Beta version. Join now. 
http://ideas.live.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: MySQL exits abnormally in Emacs
  2006-12-16  3:37   ` Corey Foote
@ 2006-12-16  3:42     ` Juanma Barranquero
  2006-12-16  4:28       ` Corey Foote
  0 siblings, 1 reply; 7+ messages in thread
From: Juanma Barranquero @ 2006-12-16  3:42 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 12/16/06, Corey Foote <coreyfoote@hotmail.com> wrote:

> When I type queries into the process buffer and press enter, no
> results are returned until I interrupt the process with C-c C-c.

How are you starting the process buffer? From a source buffer in
sql-mode, or directly running `sql-mysql'?

If you do C-c C-c from a sql-mode buffer attached to the process
buffer, do you get any results?

>From your description, it seems a problem with comint mode...

                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: MySQL exits abnormally in Emacs
  2006-12-16  3:42     ` Juanma Barranquero
@ 2006-12-16  4:28       ` Corey Foote
  2006-12-16  4:44         ` Juanma Barranquero
  0 siblings, 1 reply; 7+ messages in thread
From: Corey Foote @ 2006-12-16  4:28 UTC (permalink / raw)
  Cc: help-gnu-emacs

Hi,

I've been starting the process buffer by directly running sql-mysql,
but I also just tried doing it from a source buffer in sql-mode, and I
get the same result; No results show up until I go to the process
buffer and type C-c C-c.

When I do C-C C-c from a sql-mode buffer (after first setting SQLi
buffer to the process buffer), Emacs says, "sent string to buffer
*SQL*," but again no results show up until I go down to the
process buffer and type C-c C-c.

Corey


>From: "Juanma Barranquero" <lekktu@gmail.com>
>To: "Corey Foote" <coreyfoote@hotmail.com>
>CC: help-gnu-emacs@gnu.org
>Subject: Re: MySQL exits abnormally in Emacs
>Date: Sat, 16 Dec 2006 04:42:25 +0100
>
>On 12/16/06, Corey Foote <coreyfoote@hotmail.com> wrote:
>
>>When I type queries into the process buffer and press enter, no
>>results are returned until I interrupt the process with C-c C-c.
>
>How are you starting the process buffer? From a source buffer in
>sql-mode, or directly running `sql-mysql'?
>
>If you do C-c C-c from a sql-mode buffer attached to the process
>buffer, do you get any results?
>
>From your description, it seems a problem with comint mode...
>
>                    /L/e/k/t/u

_________________________________________________________________
All-in-one security and maintenance for your PC.  Get a free 90-day trial! 
http://clk.atdmt.com/MSN/go/msnnkwlo0050000002msn/direct/01/?href=http://clk.atdmt.com/MSN/go/msnnkwlo0050000001msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: MySQL exits abnormally in Emacs
  2006-12-16  4:28       ` Corey Foote
@ 2006-12-16  4:44         ` Juanma Barranquero
  0 siblings, 0 replies; 7+ messages in thread
From: Juanma Barranquero @ 2006-12-16  4:44 UTC (permalink / raw)
  Cc: help-gnu-emacs

On 12/16/06, Corey Foote <coreyfoote@hotmail.com> wrote:

> When I do C-C C-c from a sql-mode buffer (after first setting SQLi
> buffer to the process buffer), Emacs says, "sent string to buffer
> *SQL*," but again no results show up until I go down to the
> process buffer and type C-c C-c.

Are you passing the -n ("flush buffer after each query") option to
mysql? You can do it by configuring `sql-mysql-options'.

                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: MySQL exits abnormally in Emacs
       [not found] <mailman.1953.1166243333.2155.help-gnu-emacs@gnu.org>
@ 2006-12-16  8:26 ` Tim X
  0 siblings, 0 replies; 7+ messages in thread
From: Tim X @ 2006-12-16  8:26 UTC (permalink / raw)


"Corey Foote" <coreyfoote@hotmail.com> writes:

> Hi,
>
> I've been starting the process buffer by directly running sql-mysql,
> but I also just tried doing it from a source buffer in sql-mode, and I
> get the same result; No results show up until I go to the process
> buffer and type C-c C-c.
>
> When I do C-C C-c from a sql-mode buffer (after first setting SQLi
> buffer to the process buffer), Emacs says, "sent string to buffer
> *SQL*," but again no results show up until I go down to the
> process buffer and type C-c C-c.
>

A complete shot in the dark, but try the alternative "go" sequence
i.e. \g rather than ;. The reason I suggest this is that perhaps the ;
is geting filtered out by the comint process? (N.B. This is a SWAG)

Tim

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-12-16  8:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 21:11 MySQL exits abnormally in Emacs Corey Foote
2006-12-15 18:16 ` Juanma Barranquero
2006-12-16  3:37   ` Corey Foote
2006-12-16  3:42     ` Juanma Barranquero
2006-12-16  4:28       ` Corey Foote
2006-12-16  4:44         ` Juanma Barranquero
     [not found] <mailman.1953.1166243333.2155.help-gnu-emacs@gnu.org>
2006-12-16  8:26 ` Tim X

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).