Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'cache': 0.07; 'exists.': 0.07; 'list?': 0.07; 'postgresql': 0.07; 'puts': 0.07; 'table.': 0.07; 'experimental': 0.09; 'before.': 0.16; 'bug,': 0.16; 'chris,': 0.16; 'finds': 0.16; 'fine.': 0.16; 'received:195.186': 0.16; 'received:bluewin.ch': 0.16; 'risk,': 0.16; 'undo': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'select': 0.22; 'putting': 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; 'switch': 0.26; 'tables': 0.26; 'read,': 0.26; 'skip:" 20': 0.27; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'change,': 0.30; 'involving': 0.30; "i'm": 0.30; 'getting': 0.31; "skip:' 10": 0.31; 'fine,': 0.31; 'occurs': 0.31; 'produces': 0.31; 'routine': 0.31; 'ago': 0.33; 'not.': 0.33; 'moment': 0.34; '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; 'two': 0.37; 'list': 0.37; 'sometimes': 0.38; 'thank': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'is.': 0.60; 'lost': 0.61; 'new': 0.61; 'back': 0.62; 'skip:n 10': 0.64; 'side': 0.67; 'believe': 0.68; 'hints': 0.68; 'records.': 0.68; 'records': 0.73; 'filling': 0.78; 'difference.': 0.84; 'pardon': 0.84; 'pasting': 0.84; 'slowed': 0.84; 'subject:Where': 0.84; 'am.': 0.91 Date: Fri, 04 Oct 2013 12:05:17 +0200 From: "F.R." 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: Re: Where does MySQLdb put inserted data? References: <524E7081.3080308@bluewin.ch> In-Reply-To: <524E7081.3080308@bluewin.ch> 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380881126 news.xs4all.nl 16000 [2001:888:2000:d::a6]:59933 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55463 On 10/04/2013 09:38 AM, 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. 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) > Thank you Chris, thank you Steven, The suggestion to switch to PostgreSQL isn't lost on me. I have it installed, but have been putting off the change, apprehensive of getting slowed down by many annoying side effects for some time to come. This may be the moment . . . Off list? MySQL is. MySQLdb is not. Before I know which of the two is the culprit, I don't know whether I'm off list or not and take the risk, prepared to beg pardon if I am. Frederic