Thanks for the tip, that worked.

Sounds like InnoDB is still borked though. You should not have to use a commit unless you have started a transaction, as I understand it. The semantics for non-transaction access should be identical.

...Ken

Dan Buettner wrote:
Hi Kenneth -

it appears that you need to use an explicit 'commit' command when using
InnoDB tables and Python.

Something like this:

       try:
           cursor.execute("INSERT INTO Test1 (s1, i1) VALUES ('Now is the
time', 5)")
           db.commit()

Found this on http://www.serpia.org/mysql

HTH,
Dan


On 5/15/07, Kenneth Loafman <[EMAIL PROTECTED]> wrote:

Folks,

Here's an interesting problem for you.  I found a problem that did not
make any sense, and in diagnosing the problem I found an issue with
InnoDB vs MyISAM, so I wrote a short script to test it.  The test case
is a simple Open, Insert, Close series repeated 5 times with both
engines.  The results should be absolutely identical, except for the
timestamp, but you can see the results below are not.  The InnoDB engine
is dropping all but the last insert.

mysql --version yields "mysql  Ver 14.12 Distrib 5.0.24a, for
pc-linux-gnu (x86_64) using readline 5.1", running on Ubunty Edgy.

Before I report this as a bug, can anyone see anything obvious that I'm
missing.

The attached test case should generate:

Database engine is 'myisam'
(1L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(2L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(3L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(4L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(5L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
Database engine is 'innodb'
(1L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(2L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(3L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(4L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(5L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)

Instead, it generates:

Database engine is 'myisam'
(1L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(2L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(3L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(4L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
(5L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)
Database engine is 'innodb'
(5L, datetime.datetime(2007, 5, 15, 14, 27, 59), 'Now is the time', 5)


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to