ó
H`¾Tc           @   sØ   d  Z  d d l m Z m Z m Z m Z d d l m Z m Z m	 Z	 m
 Z
 d d l m Z d d l m Z d e e f d „  ƒ  YZ d	 e e f d
 „  ƒ  YZ d e	 e f d „  ƒ  YZ d e
 e f d „  ƒ  YZ e Z d S(   sÓ  

.. dialect:: mysql+mysqldb
    :name: MySQL-Python
    :dbapi: mysqldb
    :connectstring: mysql+mysqldb://<user>:<password>@<host>[:<port>]/<dbname>
    :url: http://sourceforge.net/projects/mysql-python


Unicode
-------

MySQLdb requires a "charset" parameter to be passed in order for it
to handle non-ASCII characters correctly.   When this parameter is passed,
MySQLdb will also implicitly set the "use_unicode" flag to true, which means
that it will return Python unicode objects instead of bytestrings.
However, SQLAlchemy's decode process, when C extensions are enabled,
is orders of magnitude faster than that of MySQLdb as it does not call into
Python functions to do so.  Therefore, the **recommended URL to use for
unicode** will include both charset and use_unicode=0::

    create_engine("mysql+mysqldb://user:pass@host/dbname?charset=utf8&use_unicode=0")

As of this writing, MySQLdb only runs on Python 2.   It is not known how
MySQLdb behaves on Python 3 as far as unicode decoding.


Known Issues
-------------

MySQL-python version 1.2.2 has a serious memory leak related
to unicode conversion, a feature which is disabled via ``use_unicode=0``.
It is strongly advised to use the latest version of MySQL-Python.

i   (   t   MySQLDialectt   MySQLExecutionContextt   MySQLCompilert   MySQLIdentifierPrepareri   (   t   MySQLDBExecutionContextt   MySQLDBCompilert   MySQLDBIdentifierPreparert   MySQLDBConnector(   t   TEXT(   t   sqlt   MySQLExecutionContext_mysqldbc           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    sg   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.pyR
   8   s   t   MySQLCompiler_mysqldbc           B   s   e  Z RS(    (   R   R   (    (    (    sg   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.pyR   >   s   t   MySQLIdentifierPreparer_mysqldbc           B   s   e  Z RS(    (   R   R   (    (    (    sg   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.pyR   B   s   t   MySQLDialect_mysqldbc           B   s#   e  Z e Z e Z e Z d  „  Z RS(   c         C   sŒ   | j  d |  j j d ƒ |  j j d ƒ f ƒ } | rm t j t j t j d ƒ t d d ƒ ƒ d ƒ g } n g  } t t	 |  ƒ j
 | | ƒ S(   Ns4   show collation where %s = 'utf8' and %s = 'utf8_bin't   Charsett	   Collations   'test collated returns't   charsett   utf8t   utf8_bin(   t   scalart   identifier_preparert   quoteR	   t   collatet   castt   literal_columnR   t   superR   t   _check_unicode_returns(   t   selft
   connectiont   has_utf8_bint   additional_tests(    (    sg   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.pyR   M   s    (	   R   R   R
   t   execution_ctx_clsR   t   statement_compilerR   t   preparerR   (    (    (    sg   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.pyR   H   s   N(   t   __doc__t   baseR    R   R   R   t   connectors.mysqldbR   R   R   R   R   t    R	   R
   R   R   R   t   dialect(    (    (    sg   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/mysqldb.pyt   <module>*   s   ""