lecram/PyMySQL — pull request #4 by methane (2013-09-11 10:49:42+00:00)
Title: Fix nested exception raised.

There are some oddness things.

1. `raise exc, value` is not `raise exc(value)`

```python
In [8]: t = TypeError('foo')
In [10]: try:
....: raise TypeError, t
....: except Exception as e:
....: exc = e
....:

In [11]: exc is t
Out[11]: True

In [12]: try:
....: raise TypeError(t)
....: except Exception as e:
....: exc = e
....:

In [13]: exc is t
Out[13]: False

In [14]: exc
Out[14]: TypeError(TypeError('foo'))
```

2. Double error message.
This is same to MySQLdb

```python
In [16]: con.messages
Out[16]: []

In [17]: cur = con.cu
con.cursor con.cursorclass

In [17]: cur = con.cursor()

In [18]: cur.exe
cur.execute cur.executemany

In [18]: cur.execute("CREATE TABLE t")
---------------------------------------------------------------------------
ProgrammingError Traceback (most recent call last)
in ()
----> 1 cur.execute("CREATE TABLE t")

/home/methane/.venvs/default/local/lib/python2.7/site-packages/MySQLdb/cursors.pyc in execute(self, query, args)
199 del tb
200 self.messages.append((exc, value))
--> 201 self.errorhandler(self, exc, value)
202 self._executed = query
203 if not self._defer_warnings: self._warning_check()

/home/methane/.venvs/default/local/lib/python2.7/site-packages/MySQLdb/connections.pyc in defaulterrorhandler(***failed resolving arguments***)
34 del cursor
35 del connection
---> 36 raise errorclass, errorvalue
37
38 re_numeric_part = re.compile(r"^(\d+)")

ProgrammingError: (1113, 'A table must have at least 1 column')

In [19]: cur.messages
Out[19]:
[(_mysql_exceptions.ProgrammingError,
_mysql_exceptions.ProgrammingError(1113,
'A table must have at least 1 column')),
(_mysql_exceptions.ProgrammingError,
_mysql_exceptions.ProgrammingError(1113,
'A table must have at least 1 column'))]
```