database in python ?

Andy Dustman farcepest at gmail.com
Tue Apr 12 16:54:12 EDT 2005


Buck Nuggets wrote:

> 1.  mysql doesn't support transactions - one of its io layers
(innodb)
> does.  If you're hoping to get your application hosted you will find
> that most mysql installations don't support innodb.  And due to the
> bugs in mysql, when you attempt to create a transaction-safe table in
> mysql if innodb isn't available it will just silently create it in
> myisam, and your transactions will be silently ignored.

That's not a bug; it's an explicitly-stated design choice.

http://dev.mysql.com/doc/mysql/en/create-table.html

     If a storage engine is specified that is not available, MySQL
     uses MyISAM instead.

> 2.  mysql is still missing quite a few database basics - views are
the
> most amazing omission, but the list also includes triggers and stored
> procedures as well.  Although most of these features are included in
> the new beta, they aren't yet available in production.

Views, triggers, stored procedures are all available in 5.0.2 (beta).

> 3.  mysql has an enormous number of non-standard features such as
> comment formatting, how nulls work, concatenation operator, etc.
This
> means that you'll learn non-standard sql, and most likely write
> non-portable sql.

SET GLOBAL sql_mode='ansi'; and you won't have to worry about it.

> 4.  additionally, mysql has a peculiar set of bugs - in which the
> database will change your data and report no exception.  These bugs
> were probably a reflection of mysql's marketing message that the
> database should do nothing but persist data, and data quality was the
> responsibility of the application.  This self-serving message appears
> to have been dropped now that they are catching up with other
products,
> but there's a legacy of cruft that still remains.  Examples of these
> errors include:  silent truncation of strings to fit max varchar
> length, allows invalid dates, truncation of numeric data to fit max
> numeric values, etc.

MySQL gives warnings when data is truncated or misformatted.

http://dev.mysql.com/doc/mysql/en/mysql-info.html
http://dev.mysql.com/doc/mysql/en/mysql-warning-count.html
http://dev.mysql.com/doc/mysql/en/show-warnings.html

Since we're in comp.lang.python, MySQLdb-1.2 uses the warnings module
to alert you to this. MySQLdb-1.0 and earlier would raise a Warning
exception (or not, if you used a different cursor class).

Implicit default column values can disabled in 5.0.2 by running the
server in strict mode.

http://dev.mysql.com/doc/mysql/en/server-sql-mode.html

> 5.  cost: mysql isn't expensive, but it isn't free either.  Whether
or
> not you get to use it for free depends on how you interpret their
> licensing info and faq.  MySQL's recommendation if you're confused
(and
> many are) is to license the product or call one of their reps.

MySQL is licensed under the GPL. You can buy a commercial license if
you don't want the GPL's restrictions.

http://www.mysql.com/company/legal/licensing/

> Bottomline - mysql has a lot of marketshare, is improving, and I'm
sure
> that it'll eventually be a credible product.  But right now it's has
a
> wide range of inexcusable problems.

It's not a bug if you didn't RTFM.




More information about the Python-list mailing list