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


Groups > comp.lang.python > #55454

Where does MySQLdb put inserted data?

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <anthra.norell@bluewin.ch>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.019
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'cache': 0.07; 'exists.': 0.07; 'puts': 0.07; 'table.': 0.07; 'experimental': 0.09; 'before.': 0.16; 'bug,': 0.16; 'finds': 0.16; 'fine.': 0.16; 'received:195.186': 0.16; 'received:bluewin.ch': 0.16; 'undo': 0.16; 'file,': 0.19; 'select': 0.22; 'skip:+ 20': 0.22; 'header :User-Agent:1': 0.23; 'error': 0.23; 'commands,': 0.24; 'format,': 0.24; 'recognize': 0.24; 'looks': 0.24; 'skip:" 30': 0.26; 'tables': 0.26; 'read,': 0.26; 'skip:" 20': 0.27; 'values': 0.27; 'involving': 0.30; "skip:' 10": 0.31; 'fine,': 0.31; 'occurs': 0.31; 'produces': 0.31; 'routine': 0.31; 'ago': 0.33; 'table': 0.34; 'could': 0.34; 'late': 0.35; 'operations': 0.35; 'but': 0.35; 'explains': 0.36; 'subject:data': 0.36; "didn't": 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'hi,': 0.36; 'similar': 0.36; 'should': 0.36; 'sometimes': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'new': 0.61; 'back': 0.62; 'skip:n 10': 0.64; 'believe': 0.68; 'hints': 0.68; 'records.': 0.68; 'records': 0.73; 'filling': 0.78; 'difference.': 0.84; 'pasting': 0.84; 'subject:Where': 0.84
Date Fri, 04 Oct 2013 09:38:41 +0200
From "F.R." <anthra.norell@bluewin.ch>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130510 Thunderbird/17.0.6
MIME-Version 1.0
To python-list@python.org
Subject Where does MySQLdb put inserted data?
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.709.1380872395.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1380872395 news.xs4all.nl 15941 [2001:888:2000:d::a6]:45638
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:55454

Show key headers only | View raw


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)

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

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

csiph-web