Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55454 > unrolled thread

Where does MySQLdb put inserted data?

Started by"F.R." <anthra.norell@bluewin.ch>
First post2013-10-04 09:38 +0200
Last post2013-10-04 08:34 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Where does MySQLdb put inserted data? "F.R." <anthra.norell@bluewin.ch> - 2013-10-04 09:38 +0200
    Re: Where does MySQLdb put inserted data? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-04 08:34 +0000

#55454 — Where does MySQLdb put inserted data?

From"F.R." <anthra.norell@bluewin.ch>
Date2013-10-04 09:38 +0200
SubjectWhere does MySQLdb put inserted data?
Message-ID<mailman.709.1380872395.18130.python-list@python.org>
Hi,
     As of late clipboard pasting into a terminal sometimes fails (a 
known bug, apparently), I use MySQLdb to access MySQL tables. In general 
this works just fine. But now I fail filling a new table. The table 
exists. "mysql>EXPLAIN new_table;" explains and "root@blackbox-one:/# 
sudo/find / -name 'new_table*'" finds "/var/lib/mysql/fr/new_table.frm". 
So I do "cursor.executemany ('insert into new_table values (%s)' % 
format, data)". No error occurs and "cursor.execute ('select * from 
new_table;')" returns the number of records read, and "cursor.fetchall 
()" returns all new records. All looks fine, but "mysql>SELECT * FROM 
new_table;" produces an "Empty set" and "sudo find / -name 'new_table*" 
still finds only the format file, same as before.
     Could it have to do with COMMIT. I believe I am using ISAM tables 
(default?) and those don't recognize undo commands, right?. Anyway, an 
experimental "cursor.execute ('COMMIT')" didn't make a difference. It 
looks like MySQLdb puts the data into a cache and that cache should be 
saved either by the OS or by me. Strange thing is that this is one freak 
incident in an almost daily routine going back years and involving 
thousands of access operations in and out acting instantaneously. I seem 
to remember a similar case some time ago and it also involved a new 
empty table.

Thanks for hints

Frederic



mysql> select version()
     -> ;
+-------------------------+
| version()               |
+-------------------------+
| 5.5.31-0ubuntu0.12.04.1 |
+-------------------------+
1 row in set (0.00 sec)

[toc] | [next] | [standalone]


#55457

FromSteven D'Aprano <steve+comp.lang.python@pearwood.info>
Date2013-10-04 08:34 +0000
Message-ID<524e7d8e$0$29984$c3e8da3$5496439d@news.astraweb.com>
In reply to#55454
On Fri, 04 Oct 2013 09:38:41 +0200, F.R. wrote:

> Hi,
>      As of late clipboard pasting into a terminal sometimes fails (a
> known bug, apparently), I use MySQLdb to access MySQL tables.
[...]


You appear to have posted to the wrong list. This is a Python list, not 
MySQL. Nothing in your question appears to be about Python. If I am 
mistaken, please re-word your question explain what Python code you are 
having trouble with, what you tried, what you expected, and what it 
actually did.



-- 
Steven

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web