Commit Graph

7782 Commits

Author SHA1 Message Date
Mike Bayer e3a7015f89 Fixes to the `sqlalchemy.ext.serializer` extension, including
that the "id" passed from the pickler is turned into a string
to prevent against bytes being parsed on Py3K, as well as that
``relationship()`` and ``orm.join()`` constructs are now properly
serialized. [ticket:2698] and some other observed issues.
2013-04-26 15:51:29 -04:00
Mike Bayer 22c4ae0aaf changelog for [ticket:2714] 2013-04-26 15:04:42 -04:00
Mike Bayer 3e49ac5161 and a lot of tests. five fail without the change 2013-04-26 13:08:28 -04:00
Mike Bayer 8e66f41f69 - further cleanup. in particular, the left clause is never None. But we still
can have errors when we do the auto-join, these are both covered in test_joins
2013-04-25 14:44:37 -04:00
Mike Bayer e1d0356968 we can always adapt to right also. suppose if right
were an alias of a table, should add tests for that.
2013-04-25 14:29:48 -04:00
Mike Bayer 0ed0bdb2ae heh dont need that either 2013-04-25 14:16:54 -04:00
Mike Bayer 9506bbe82f dont need this 2013-04-25 14:14:23 -04:00
Mike Bayer 68b844df4f cleanup 2013-04-25 14:13:13 -04:00
Mike Bayer 6f05aa06bf everything passes with this!!!!!!! holy crap !!!!! and its the simplest of all 2013-04-25 13:54:40 -04:00
Mike Bayer 6372327097 - attempt to replace the whole idea of "join_to_left" with a more
fundamental and general purpose heuristic.   this initial approach
has about 60 tests failing but seems to have gone pretty far
2013-04-24 18:58:09 -04:00
Mike Bayer c3c9a3f701 break into multiple tests 2013-04-24 18:10:16 -04:00
Mike Bayer b25e11f6a8 formatting 2013-04-24 17:49:24 -04:00
Mike Bayer 7a26ad2ef1 - merge exists() patch + changelog 2013-04-23 20:06:04 -04:00
Mike Bayer 77e0a5dffe Added a conditional to the unpickling process for ORM
mapped objects, such that if the reference to the object
were lost when the object was pickled, we don't
erroneously try to set up _sa_instance_state - fixes
a NoneType error.
2013-04-23 13:23:48 -04:00
Mike Bayer 177ad548c4 - only search in the exception before the first newline, to avoid
false positives for SQL statements containing certain text
2013-04-23 13:07:36 -04:00
Mike Bayer 00c163bfb1 Opened up the checking for "disconnect" with psycopg2/libpq
to check for all the various "disconnect" messages within
the full exception hierarchy.  Specifically the
"closed the connection unexpectedly" message has now been
seen in at least three different exception types.
[ticket:2712]
2013-04-22 19:33:39 -04:00
Mike Bayer 5884c2e7e5 Fully implemented the IS and IS NOT operators with
regards to the True/False constants.  An expression like
``col.is_(True)`` will now render ``col IS true``
on the target platform, rather than converting the True/
False constant to an integer bound parameter.
This allows the ``is_()`` operator to work on MySQL when
given True/False constants.
[ticket:2682]
2013-04-22 19:12:47 -04:00
Mike Bayer 63c211f427 tweak this some more to handle the array being empty again 2013-04-22 17:24:31 -04:00
Mike Bayer d2f8c83e25 - change to [ticket:2681], pre-coerce the array to list
unconditonally instead so that it works in all cases.
2013-04-22 17:08:02 -04:00
Mike Bayer 422f471871 The operators for the Postgresql ARRAY type supports
input types of sets, generators, etc. but only when a dimension
is specified for the ARRAY; otherwise, the dialect
needs to peek inside of "arr[0]" to guess how many
dimensions are in use.  If this occurs with a non
list/tuple type, the error message is now informative
and directs to specify a dimension for the ARRAY.
[ticket:2681]
2013-04-22 16:57:15 -04:00
Mike Bayer e79fd50e58 - changelog
- just do a fetchone() here, no need for len() etc.
2013-04-21 17:23:03 -04:00
Mike Bayer e4c50c07bb merge cymysql branch 2013-04-21 17:19:07 -04:00
Mike Bayer 3aff498e4a merge into cymysql branch... 2013-04-21 17:18:49 -04:00
Mike Bayer 23c744b54e - Improvements to the operation of the pymysql dialect on
Python 3, including some important decode/bytes steps.
Issues remain with BLOB types due to driver issues.
Courtesy Ben Trofatter.
- start using util.py3k, we will eventually remove the
sa2to3 fixer entirely
2013-04-21 17:09:45 -04:00
Mike Bayer d5af821b5d Merged in bentrofatter/sqlalchemy-2663 (pull request #49)
Fixed PyMySQL problems for Python 2.x and mitigated some issues with Python 3.x
2013-04-21 16:58:55 -04:00
Mike Bayer b5ab6d4107 - identify [ticket:2710] as a regression from [ticket:2229], doesn't
need to be in 0.7.
2013-04-21 11:47:43 -04:00
Mike Bayer 3a536ad1ba Fixed bug where many-to-many relationship with uselist=False
would fail to delete the association row and raise an error
if the scalar attribute were set to None.  Also in 0.7.11.
[ticket:2710]
2013-04-21 11:31:29 -04:00
Mike Bayer a6906cd0a9 - remove lots of old tests here that are covered
elsewhere, cleanup
2013-04-21 11:09:51 -04:00
Mike Bayer 41b70ff888 - establish ordering here for the hstore repr test 2013-04-20 11:47:25 -04:00
Mike Bayer 666fda3c9c order the properties here to get the SQL to be deterministic 2013-04-20 11:44:27 -04:00
Mike Bayer 6ae1e89961 - these pickle the assoc proxy by itself tests can't really pass
now without strong ref on the parent
- fix message compare for py3k
2013-04-20 05:34:40 -04:00
Hajime Nakagami fbcdba12f8 merge from default 2013-04-20 17:10:23 +09:00
Hajime Nakagami af9ed1ff16 testing.crashes on cymysql >= 0.6 2013-04-20 16:33:32 +09:00
Mike Bayer 7f0ee900b6 - this issue is a bug, mention the apply_labels issue sooner 2013-04-20 03:09:10 -04:00
Mike Bayer 39259d94f5 - dont do a boolean check on the mapped object 2013-04-20 02:59:58 -04:00
Hajime Nakagami a6a311cd1a skip with cymysql 0.6 2013-04-20 15:54:33 +09:00
Mike Bayer 6c1972e4ec Improved the behavior of instance management regarding
the creation of strong references within the Session;
an object will no longer have an internal reference cycle
created if it's in the transient state or moves into the
detached state - the strong ref is created only when the
object is attached to a Session and is removed when the
object is detached.  This makes it somewhat safer for an
object to have a `__del__()` method, even though this is
not recommended, as relationships with backrefs produce
cycles too.  A warning has been added when a class with
a `__del__()` method is mapped.
[ticket:2708]
2013-04-20 02:45:08 -04:00
Mike Bayer 15b3d2f5bd changelog for pullreq 54 gaerdbms 2013-04-19 21:41:11 -04:00
Dan Ring d657cf0600 Fix mysql+gaerdbms dialect for changed exception format
googleappengine v1.7.5 changed the exception format to be
incompatible with MySQLDialect_gaerdbms#_extract_error_code

This fix works for both old- and new-style exceptions.

Changes causing the breakage:
/trunk/python/google/storage/speckle/python/api/rdbms.py
at
https://code.google.com/p/googleappengine/source/detail?r=318
2013-04-19 18:01:39 -07:00
Mike Bayer b6bf8c2a30 Fixed a long-standing bug in the caching example, where
the limit/offset parameter values wouldn't be taken into
account when computing the cache key.  The
_key_from_query() function has been simplified to work
directly from the final compiled statement in order to get
at both the full statement as well as the fully processed
parameter list.
2013-04-18 20:11:08 -04:00
Mike Bayer 23c43e94b0 - remove erroneous second RelationshipCache class 2013-04-18 18:35:45 -04:00
Mike Bayer 0790efcf87 - this pymssql test needs to be against the pymssql dialect
- Part of a longer series of fixes needed for pyodbc+
      mssql, a CAST to NVARCHAR(max) has been added to the bound
      parameter for the table name and schema name in all information schema
      queries to avoid the issue of comparing NVARCHAR to NTEXT,
      which seems to be rejected by the ODBC driver in some cases,
      such as FreeTDS (0.91 only?) plus unicode bound parameters being passed.
      The issue seems to be specific to the SQL Server information
      schema tables and the workaround is harmless for those cases
      where the problem doesn't exist in the first place.
[ticket:2355]
2013-04-18 17:41:30 -04:00
Mike Bayer 835f0abb59 python2.5 fix 2013-04-18 15:45:15 -04:00
Mike Bayer 1b9c1a2ecf - test + changelog for [ticket:2691] 2013-04-18 12:01:16 -04:00
Mike Bayer 6d93918b9b - remove reference to _exc_info before reraise to reduce cycles 2013-04-18 11:04:51 -04:00
Mike Bayer 0bb05ffdf0 Reworked internal exception raises that emit
a rollback() before re-raising, so that the stack
trace is preserved from sys.exc_info() before entering
the rollback.  This so that the traceback is preserved
when using coroutine frameworks which may have switched
contexts before the rollback function returns.
[ticket:2703]
2013-04-18 11:00:12 -04:00
Mike Bayer e5d0592180 - additional test + correction for [ticket:2699] 2013-04-18 10:34:59 -04:00
Mike Bayer f14ec0f517 add cymysql... 2013-04-14 19:32:54 -04:00
Hajime Nakagami f801e546e7 mysql+cymysql dialect supports_sane_rowcount = False 2013-04-13 18:19:05 +09:00
Hajime Nakagami 2d10dbde03 a bit revert 2013-04-13 18:04:31 +09:00