[pypy-svn] r80283 - pypy/pysqlite2
antocuni at codespeak.net
antocuni at codespeak.net
Fri Feb 4 13:44:14 CET 2011
Author: antocuni
Date: Fri Feb 4 13:44:12 2011
New Revision: 80283
Modified:
pypy/pysqlite2/dbapi2.py
Log:
revert r80282, I checked it in by mistake
Modified: pypy/pysqlite2/dbapi2.py
==============================================================================
--- pypy/pysqlite2/dbapi2.py (original)
+++ pypy/pysqlite2/dbapi2.py Fri Feb 4 13:44:12 2011
@@ -205,46 +205,6 @@
sqlite.sqlite3_result_error.argtypes = [c_void_p, c_char_p, c_int]
sqlite.sqlite3_result_text.argtypes = [c_void_p, c_char_p, c_int, c_void_p]
-# new
-# ===================================
-
-# safe
-
-sqlite.sqlite3_libversion.argtypes = []
-sqlite.sqlite3_column_blob.argtypes = [c_void_p, c_int]
-sqlite.sqlite3_column_bytes.argtypes = [c_void_p, c_int]
-sqlite.sqlite3_column_double.argtypes = [c_void_p, c_int]
-sqlite.sqlite3_column_int64.argtypes = [c_void_p, c_int]
-sqlite.sqlite3_column_name.argtypes = [c_void_p, c_int]
-sqlite.sqlite3_column_text.argtypes = [c_void_p, c_int]
-sqlite.sqlite3_errcode.argtypes = [c_void_p]
-sqlite.sqlite3_errmsg.argtypes = [c_void_p]
-sqlite.sqlite3_column_count.argtypes = [c_void_p]
-sqlite.sqlite3_column_count.restype = c_int
-sqlite.sqlite3_reset.argtypes = [c_void_p]
-sqlite.sqlite3_reset.restype = c_int
-
-# unsafe
-
-
-sqlite.sqlite3_step.argtypes = [c_void_p]
-sqlite.sqlite3_step.restype = c_int
-sqlite.sqlite3_finalize.argtypes = [c_void_p]
-sqlite.sqlite3_finalize.restype = c_int
-
-## sqlite.sqlite3_column_type.argtypes = [c_void_p, c_int]
-## sqlite.sqlite3_column_type.restype = c_int
-## sqlite.sqlite3_total_changes.argtypes = [c_void_p]
-## sqlite.sqlite3_total_changes.restype = c_int
-## sqlite.sqlite3_bind_null.argtypes = [c_void_p, c_int]
-## sqlite.sqlite3_bind_null.restype = c_int
-## sqlite.sqlite3_busy_timeout.argtypes = [c_void_p, c_int]
-## sqlite.sqlite3_busy_timeout.restype = c_int
-## sqlite.sqlite3_value_type.argtypes = [c_void_p]
-## sqlite.sqlite3_value_type.restype = c_int
-
-
-
##########################################
# END Wrapped SQLite C API and constants
##########################################
@@ -409,13 +369,9 @@
sql = "BEGIN " + self._isolation_level
statement = c_void_p()
next_char = c_char_p()
- psql = c_char_p(sql)
- ret = sqlite.sqlite3_prepare_v2(self.db, psql, -1, byref(statement), next_char)
+ ret = sqlite.sqlite3_prepare_v2(self.db, sql, -1, byref(statement), next_char)
if ret != SQLITE_OK:
- xx = self._get_exception(ret)
- if 'syntax error' in str(xx):
- import pdb;pdb.set_trace()
- raise xx
+ raise self._get_exception(ret)
ret = sqlite.sqlite3_step(statement)
if ret != SQLITE_DONE:
raise self._get_exception(ret)
@@ -431,13 +387,9 @@
sql = "COMMIT"
statement = c_void_p()
next_char = c_char_p()
- psql = c_char_p(sql)
- ret = sqlite.sqlite3_prepare_v2(self.db, psql, -1, byref(statement), next_char)
+ ret = sqlite.sqlite3_prepare_v2(self.db, sql, -1, byref(statement), next_char)
if ret != SQLITE_OK:
- xx = self._get_exception(ret)
- if 'syntax error' in str(xx) or 'token' in str(xx):
- import pdb;pdb.set_trace()
- raise xx
+ raise self._get_exception(ret)
ret = sqlite.sqlite3_step(statement)
if ret != SQLITE_DONE:
raise self._get_exception(ret)
@@ -678,18 +630,14 @@
self.statement = c_void_p()
next_char = c_char_p()
- psql = c_char_p(sql)
- ret = sqlite.sqlite3_prepare_v2(self.con.db, psql, -1, byref(self.statement), byref(next_char))
+ ret = sqlite.sqlite3_prepare_v2(self.con.db, sql, -1, byref(self.statement), byref(next_char))
if ret == SQLITE_OK and self.statement.value is None:
# an empty statement, we work around that, as it's the least trouble
ret = sqlite.sqlite3_prepare_v2(self.con.db, "select 42", -1, byref(self.statement), byref(next_char))
self.kind = "DQL"
if ret != SQLITE_OK:
- xx = self.con._get_exception(ret)
- if 'syntax error' in str(xx):
- import pdb;pdb.set_trace()
- raise xx
+ raise self.con._get_exception(ret)
self.con._remember_statement(self)
if _check_remaining_sql(next_char.value):
raise Warning, "One and only one statement required"
More information about the Pypy-commit
mailing list