mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 11:10:58 +08:00
0.9.0c1 minor edit.
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
prune CVS
|
||||
recursive-include doc *
|
||||
recursive-include examples *
|
||||
include _mysql_version.h
|
||||
include README.MySQLmodule
|
||||
include license.py
|
||||
include MANIFEST.in
|
||||
|
@ -19,17 +19,18 @@ version_info = (
|
||||
0,
|
||||
9,
|
||||
0,
|
||||
"beta",
|
||||
3)
|
||||
"candidate",
|
||||
1)
|
||||
if version_info[3] == "final": __version__ = "%d.%d.%d" % version_info[:3]
|
||||
else: __version__ = "%d.%d.%d%1.1s%d" % version_info[:5]
|
||||
|
||||
import _mysql
|
||||
|
||||
if __version__ != getattr(_mysql, '__version__', None):
|
||||
v = getattr(_mysql, 'version_info', None)
|
||||
if version_info != v:
|
||||
raise ImportError, "this is MySQLdb version %s, but _mysql is version %s" %\
|
||||
(__version__, _mysql.__version__)
|
||||
|
||||
(version_info, v)
|
||||
del v
|
||||
|
||||
threadsafety = 1
|
||||
apilevel = "2.0"
|
||||
|
@ -58,7 +58,6 @@ class Connection:
|
||||
self._db = apply(connect, args, kwargs2)
|
||||
self._db.converter[types.StringType] = self._db.string_literal
|
||||
self._transactional = self._db.server_capabilities & CLIENT.TRANSACTIONS
|
||||
self._autocommit = 1
|
||||
|
||||
def __del__(self):
|
||||
if hasattr(self, '_db'): self.close()
|
||||
@ -67,34 +66,21 @@ class Connection:
|
||||
"""Close the connection. No further activity possible."""
|
||||
self._db.close()
|
||||
|
||||
def autocommit(self, v):
|
||||
"""Turn autocommit on or off."""
|
||||
self._db.query("SET AUTOCOMMIT=%d"%v)
|
||||
self._transactional = not v
|
||||
self._autocommit = v
|
||||
|
||||
def begin(self):
|
||||
"""Explicitly begin a transaction. Non-standard."""
|
||||
self._db.query("BEGIN")
|
||||
self._transactional = 1
|
||||
|
||||
def commit(self):
|
||||
"""Commit the current transaction."""
|
||||
try:
|
||||
if self._transactional:
|
||||
self._db.query("COMMIT")
|
||||
finally:
|
||||
self._transactional = not self._autocommit
|
||||
if self._transactional:
|
||||
self._db.query("COMMIT")
|
||||
|
||||
def rollback(self):
|
||||
"""Rollback the current transaction."""
|
||||
try:
|
||||
if self._transactional:
|
||||
self._db.query("ROLLBACK")
|
||||
else:
|
||||
raise NotSupportedError, "Not supported by server"
|
||||
finally:
|
||||
self._transactional = not self._autocommit
|
||||
if self._transactional:
|
||||
self._db.query("ROLLBACK")
|
||||
else:
|
||||
raise NotSupportedError, "XXX Not supported by server"
|
||||
|
||||
def cursor(self, cursorclass=None):
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "_mysql_version.h"
|
||||
#define version_info "(0,9,0,'candidate',1)"
|
||||
#define __version__ "0.9.0c1"
|
||||
/*
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -1560,8 +1561,12 @@ init_mysql(void)
|
||||
_mysql_ResultObject_Type.ob_type = &PyType_Type;
|
||||
#endif
|
||||
if (!(dict = PyModule_GetDict(module))) goto error;
|
||||
if (PyDict_SetItemString(dict, "version_info",
|
||||
PyRun_String(version_info, Py_eval_input,
|
||||
dict, dict)))
|
||||
goto error;
|
||||
if (PyDict_SetItemString(dict, "__version__",
|
||||
PyString_FromString(_mysql__version__)))
|
||||
PyString_FromString(__version__)))
|
||||
goto error;
|
||||
if (!(emod = PyImport_ImportModule("_mysql_exceptions")))
|
||||
goto error;
|
||||
|
@ -1 +0,0 @@
|
||||
static char _mysql__version__[] = "0.9.0b3";
|
@ -68,8 +68,7 @@ must use a transaction-safe table (TST). Current TSTs are BDB and
|
||||
InnoDB. GEMINI tables are slated for MySQL-4.0. Note that MySQL
|
||||
generally operates in <tt/AUTOCOMMIT/ mode by default, and MySQLdb
|
||||
assumes that <tt/AUTOCOMMIT/ is on by default. To change this, use the
|
||||
<tt/autocommit(n)/ method; otherwise MySQLdb will not know that that
|
||||
you have changed it.
|
||||
<tt/SET AUTOCOMMIT=0/ SQL statement.
|
||||
|
||||
<sect1>DateTime <p>If you have the <htmlurl
|
||||
url="http://www.lemburg.com/files/python/mxDateTime.html"
|
||||
@ -516,10 +515,6 @@ Compatibility note: The older <ref id="MySQLmodule"> defines this method,
|
||||
can use <tt/begin()/ to temporarily turn it off. AUTOCOMMIT will
|
||||
resume after the next <tt/commit()/ or <tt/rollback/.
|
||||
|
||||
<tag>autocommit(n)</tag> Turns AUTOCOMMIT mode on or off. This affects
|
||||
how transactions are handled. By default, MySQL operates in
|
||||
AUTOCOMMIT mode.
|
||||
|
||||
</descrip>
|
||||
|
||||
<sect1>Cursor Objects
|
||||
|
2
MySQLdb/setup.cfg
Normal file
2
MySQLdb/setup.cfg
Normal file
@ -0,0 +1,2 @@
|
||||
[bdist_rpm]
|
||||
doc_files = README doc/*.?tml
|
@ -75,11 +75,12 @@ MySQLdb. MySQLdb is free software.
|
||||
|
||||
setup (# Distribution meta-data
|
||||
name = "MySQL-python",
|
||||
version = "0.9.0b3",
|
||||
version = "0.9.0c1",
|
||||
description = "An interface to MySQL",
|
||||
long_description=long_description,
|
||||
author = "Andy Dustman",
|
||||
author_email = "andy@dustman.net",
|
||||
licence = "GPL",
|
||||
url = "http://dustman.net/andy/python/MySQLdb",
|
||||
|
||||
# Description of the modules and packages in the distribution
|
||||
|
Reference in New Issue
Block a user