MySQL Connector/Python 1.0.9 available for download

Today we released MySQL Connector/Python v1.0.9. Release notes can be found in the MySQL Developver Zone.

Connector/Python v1.0.9 contains some important fixes, especially for the Windows platform. It also comes with a new connection argument called force_ipv6, and can be used to force IPv6 when an address resolves to both IPv4 and v6. Also, RPM packages have been made available in addition to the TAR/ZIP and MSI packages.

Please use the MySQL Bugs website to report any problem.

Some useful links:

Enjoy!

Comments

webknjaz
Could you please fix package on pypi? It still points to 1.0.7 download link, wich is broken. So I cannon just do pip install :(
Geert Vanderkelen
@webknjaz Indeed! 1.0.9 is now available through PyPI.
zhang

Hi Geert,

mysql-connector-python dose not support last_insert_id yet, right? I could not find any function about it in refman.

Thanks,

Geert Vanderkelen

@zhang It is.. indeed not in the documentation. That’s something we need to fix. However, it is part of PEP-249, and it is a cursor property called ‘lastrowid’

Example:

import mysql.connector cnx = mysql.connector.connect(…….) cur = cnx.cursor() cur.execute(“INSERT INTO t1 (c1) VALUES (‘ham’)”) cur.lastrowid 1

zhang

ya..it is cool

this afternoon I also tried lastrowid like MySQLdb. It is excited to me that SHE is already there :P rowcount is also available even though it is yet to document.

thanks,

zhang

sorry…many questions

I am puzzled about with_rows. “This read-only property will return True when the result of the executed operation provides rows.” -- from RefMan But, as follow is :

query = (“select name from test_innodb where age > 100”) ## empty rows

for result in cur.execute(query): if result.with_rows: print (“Statement: {0}“.format(result.statement))

I found result.with_rows was always True if query is just SELECT statement whose result is empty or not.

Thanks,

Geert Vanderkelen

@zhang Blog is not a place for discussions. Please use the MySQL forums: http://forums.mysql.com/list.php?50

Note that ‘with_rows’ means that the query you execute could return rows. It doesn’t mean it ‘has rows’. It is meant to distinct between SELECT and INSERT for example.