sqlalchemy-tickets Mailing List for SQLAlchemy (Page 40)
Brought to you by:
zzzeek
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(174) |
Apr
(50) |
May
(71) |
Jun
(129) |
Jul
(113) |
Aug
(141) |
Sep
(82) |
Oct
(142) |
Nov
(97) |
Dec
(72) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(159) |
Feb
(213) |
Mar
(156) |
Apr
(151) |
May
(58) |
Jun
(166) |
Jul
(296) |
Aug
(198) |
Sep
(89) |
Oct
(133) |
Nov
(150) |
Dec
(122) |
| 2008 |
Jan
(144) |
Feb
(65) |
Mar
(71) |
Apr
(69) |
May
(143) |
Jun
(111) |
Jul
(113) |
Aug
(159) |
Sep
(81) |
Oct
(135) |
Nov
(107) |
Dec
(200) |
| 2009 |
Jan
(168) |
Feb
(109) |
Mar
(141) |
Apr
(128) |
May
(119) |
Jun
(132) |
Jul
(136) |
Aug
(154) |
Sep
(151) |
Oct
(181) |
Nov
(223) |
Dec
(169) |
| 2010 |
Jan
(103) |
Feb
(209) |
Mar
(201) |
Apr
(183) |
May
(134) |
Jun
(113) |
Jul
(110) |
Aug
(159) |
Sep
(138) |
Oct
(96) |
Nov
(116) |
Dec
(94) |
| 2011 |
Jan
(97) |
Feb
(188) |
Mar
(157) |
Apr
(158) |
May
(118) |
Jun
(102) |
Jul
(137) |
Aug
(113) |
Sep
(104) |
Oct
(108) |
Nov
(91) |
Dec
(162) |
| 2012 |
Jan
(189) |
Feb
(136) |
Mar
(153) |
Apr
(142) |
May
(90) |
Jun
(141) |
Jul
(67) |
Aug
(77) |
Sep
(113) |
Oct
(68) |
Nov
(101) |
Dec
(122) |
| 2013 |
Jan
(60) |
Feb
(77) |
Mar
(77) |
Apr
(129) |
May
(189) |
Jun
(155) |
Jul
(106) |
Aug
(123) |
Sep
(53) |
Oct
(142) |
Nov
(78) |
Dec
(102) |
| 2014 |
Jan
(143) |
Feb
(93) |
Mar
(35) |
Apr
(26) |
May
(27) |
Jun
(41) |
Jul
(45) |
Aug
(27) |
Sep
(37) |
Oct
(24) |
Nov
(22) |
Dec
(20) |
| 2015 |
Jan
(17) |
Feb
(15) |
Mar
(34) |
Apr
(55) |
May
(33) |
Jun
(31) |
Jul
(27) |
Aug
(17) |
Sep
(22) |
Oct
(26) |
Nov
(27) |
Dec
(22) |
| 2016 |
Jan
(20) |
Feb
(24) |
Mar
(23) |
Apr
(13) |
May
(17) |
Jun
(14) |
Jul
(31) |
Aug
(23) |
Sep
(24) |
Oct
(31) |
Nov
(23) |
Dec
(16) |
| 2017 |
Jan
(24) |
Feb
(20) |
Mar
(27) |
Apr
(24) |
May
(28) |
Jun
(18) |
Jul
(18) |
Aug
(23) |
Sep
(30) |
Oct
(17) |
Nov
(12) |
Dec
(12) |
| 2018 |
Jan
(27) |
Feb
(23) |
Mar
(13) |
Apr
(19) |
May
(21) |
Jun
(29) |
Jul
(11) |
Aug
(22) |
Sep
(14) |
Oct
(9) |
Nov
(24) |
Dec
|
|
From: Mike B. <iss...@bi...> - 2015-04-04 22:38:53
|
New issue 3356: tox doesn't run the correct code and setting up lib is not reliable https://bitbucket.org/zzzeek/sqlalchemy/issue/3356/tox-doesnt-run-the-correct-code-and Mike Bayer: patch, needs further testing: ``` #!diff diff --git a/regen_callcounts.tox.ini b/regen_callcounts.tox.ini index 056208c..e74ceef 100644 --- a/regen_callcounts.tox.ini +++ b/regen_callcounts.tox.ini @@ -12,8 +12,6 @@ deps=pytest py{27}-sqla_{cext,nocext}-db_{mysql}: mysql-python py{33,34}-sqla_{cext,nocext}-db_{mysql}: pymysql -usedevelop=False -sitepackages=True commands= @@ -22,7 +20,11 @@ commands= db_{postgresql}: {[base]basecommand} --db postgresql {posargs} db_{sqlite}: {[base]basecommand} --db sqlite {posargs} +# -E : ignore PYTHON* environment variables (such as PYTHONPATH) +# -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE setenv= - sqla_nocext: DISABLE_SQLALCHEMY_CEXT=1 + PYTHONPATH= + PYTHONNOUSERSITE=1 + sqla_nocext: DISABLE_SQLALCHEMY_CEXT=1 diff --git a/sqla_nose.py b/sqla_nose.py index fc55f34..3925fb7 100755 --- a/sqla_nose.py +++ b/sqla_nose.py @@ -10,10 +10,9 @@ import sys import nose import os - -for pth in ['./lib']: - sys.path.append( - os.path.join(os.path.dirname(os.path.abspath(__file__)), pth)) +if not sys.flags.no_user_site: + sys.path.insert(0, + os.path.join(os.path.dirname(os.path.abspath(__file__)), './lib')) # use bootstrapping so that test plugins are loaded # without touching the main library before coverage starts diff --git a/test/conftest.py b/test/conftest.py index 590b357..7572ecc 100755 --- a/test/conftest.py +++ b/test/conftest.py @@ -9,10 +9,9 @@ installs SQLAlchemy's testing plugin into the local environment. import sys import os -for pth in ['../lib']: - sys.path.append( - os.path.join(os.path.dirname(os.path.abspath(__file__)), pth)) - +if not sys.flags.no_user_site: + sys.path.insert(0, + os.path.join(os.path.dirname(os.path.abspath(__file__)), './lib')) # use bootstrapping so that test plugins are loaded # without touching the main library before coverage starts diff --git a/test/sql/test_query.py b/test/sql/test_query.py index 08afc32..aaba249 100644 --- a/test/sql/test_query.py +++ b/test/sql/test_query.py @@ -79,6 +79,8 @@ class QueryTest(fixtures.TestBase): """test that executemany parameters are asserted to match the parameter set of the first.""" + import pdb + pdb.set_trace() assert_raises_message( exc.StatementError, r"\(sqlalchemy.exc.InvalidRequestError\) A value is required for " diff --git a/tox.ini b/tox.ini index 3b1d2ea..34f40e2 100644 --- a/tox.ini +++ b/tox.ini @@ -5,8 +5,15 @@ envlist = full,py26,py27,py33,py34 deps=pytest mock -sitepackages=True -usedevelop=True +# -E : ignore PYTHON* environment variables (such as PYTHONPATH) +# -s : don't add user site directory to sys.path; also PYTHONNOUSERSITE +setenv= + PYTHONPATH= + PYTHONNOUSERSITE=1 + +sitepackages=False +usedevelop=False + commands= python -m pytest {posargs} ``` |
|
From: Mike B. <iss...@bi...> - 2015-04-04 16:31:19
|
New issue 3355: add before_connect event https://bitbucket.org/zzzeek/sqlalchemy/issue/3355/add-before_connect-event Mike Bayer: this event is to serve use cases that need to affect how the initial connection is created, without the burden of needing to provide the full-blown "creator" callable from scratch (or monkeypatch after the fact). def before_connect(connect, connect_arg, connect_kwarg, connection_record): # 1. we can manipulate the args: # connect_kwarg['foo'] = 'bar' # 2. we can do things before the connection happens, time delays, etc. log.debug("about to connect to db: %s" % connect_arg) # 3. we can do the connect ourselves, if we use retval=True new_conn = connect(*connect_arg, **connect_kwarg) new_conn.do_something() return new_conn The above "connect" is actually going to be `dialect.connect`. It would be nice if the connection pool were built to work at the level of connect + args, but at the moment it isn't, and explicit use of "creator" is widespread, so this is necessarily an engine-level event. Additionally it has to either preclude a system that actually passes "creator" to create_engine(), or work such that connect_arg and connect_kwarg are forced to empty, since user-defined creators don't accept or interact with the connect arguments. For the case where a custom pool is fully provided, we probably need to skip that case for now as well. We also should, in DefaultEngineStrategy, set up a flag so that when the event is added, and the event can't be added because "pool" was provided or "creator" was provided and we aren't covering that, we can raise an error that the event can't be used in this mode. The instrumentation would take place within DefaultEngineStrategy, but also has to be ready for an event added to an Engine after the fact; it needs to check that the event can be used at all and ensure it is called if so, else raise an error. This can be a 1.0.xx feature. Targeting at 1.1 for priority. |
|
From: Thomas T. <iss...@bi...> - 2015-04-04 13:18:10
|
New issue 3354: PostgreSQL non-native Enum fails with unicode https://bitbucket.org/zzzeek/sqlalchemy/issue/3354/postgresql-non-native-enum-fails-with Thomas Tanner: sqlalchemy 0.9.9, python 2.7.9, osx, PostgreSQL database with encoding unicode. ``` #!python # -*- coding: utf8 -*- from sqlalchemy.types import String, Integer, Enum from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, create_engine from sqlalchemy.orm import Session import sys Base = declarative_base() class Thing(Base): __tablename__ = 'thing' id = Column(Integer, primary_key=True) name = Column(String(1)) value = Column(Enum('B',u'Ü',name='myvalue', native_enum=False, convert_unicode=None)) engine = create_engine(sys.argv[1], echo=True, client_encoding='utf8') Base.metadata.create_all(engine) sess = Session(engine) sess.add(Thing(name='A', value=u'Ü')) sess.commit() sess.query(Thing).filter_by(name='A').first() ``` ``` Traceback (most recent call last): File "./utfbug.py", line 23, in <module> sess.query(Thing).filter_by(name='A').first() File "<path>/sqlalchemy/orm/query.py", line 2370, in first ret = list(self[0:1]) File "<path>/sqlalchemy/orm/query.py", line 2231, in __getitem__ return list(res) File "<path>/sqlalchemy/orm/loading.py", line 103, in instances util.raise_from_cause(err) File "<path>/sqlalchemy/util/compat.py", line 199, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "<path>/sqlalchemy/orm/loading.py", line 74, in instances rows = [process[0](row, None) for row in fetch] File "<path>/sqlalchemy/orm/loading.py", line 459, in _instance populate_state(state, dict_, row, isnew, only_load_props) File "<path>/sqlalchemy/orm/loading.py", line 309, in populate_state populator(state, dict_, row) File "<path>/sqlalchemy/orm/strategies.py", line 169, in fetch_col dict_[key] = row[col] UnicodeEncodeError: 'ascii' codec can't encode character u'\xdc' in position 0: ordinal not in range(128) ``` if I set convert_unicode=False, it works fine. mysql ist not affected. |
|
From: petergrace <iss...@bi...> - 2015-04-03 15:46:37
|
New issue 3353: combination of and_() and or_() produces unexpected sql output https://bitbucket.org/zzzeek/sqlalchemy/issue/3353/combination-of-and_-and-or_-produces petergrace: For the given filter spec, the sql generated does not match what I would expect to see: ``` #!python .filter(or_( \ and_(func.len(ExtendedCDR.Source) > 6, ExtendedCDR.DestinationContext=='ael-outbound-dial'), \ and_(func.len(ExtendedCDR.Destination)>6,ExtendedCDR.DestinationContext=='ael-std-extension') \ ) \ ``` This produces: ``` #!sql (len(cdr_extended.[Source]) > ? AND cdr_extended.[DestinationContext] = ? OR len(cdr_extended.[Destination]) > ? AND cdr_extended.[DestinationContext] = ?) ``` Note only a single set of parantheses wrapping the logic, whereas I would expect to see: ``` #!sql ( (len(cdr_extended.[Source]) > ? AND cdr_extended.[DestinationContext] = ?) OR (len(cdr_extended.[Destination]) > ? AND cdr_extended.[DestinationContext] = ?) ) ``` If I am misunderstanding how and_ and or_ are supposed to work together, can you set me straight, or alternatively let me know how I can cause sqlalchemy to emit the query with the proper order of operations? |
|
From: Mike B. <iss...@bi...> - 2015-04-02 15:53:33
|
New issue 3352: nested "begin_nested" blocks don't track owning states https://bitbucket.org/zzzeek/sqlalchemy/issue/3352/nested-begin_nested-blocks-dont-track Mike Bayer: as a result of #2452 in 9cf10db8aa4692dc6, the scope of objects within a begin_nested() is tracked based on dirtyness only. This fails when there was another begin_nested() completing successfully within the block, because dirtyness is reset in that case. Additional bookkeeping will be needed to ensure objects that are dirtied within the nested trans are tracked without being reset by a sub-transaction. ``` #!python from sqlalchemy import Column, Integer from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import Session Base = declarative_base() class Test(Base): __tablename__ = 'test' id = Column(Integer, primary_key=True) value = Column(Integer) engine = create_engine('postgresql://scott:tiger@localhost/test', echo='debug') Base.metadata.drop_all(engine) Base.metadata.create_all(engine) s = Session(engine) t1 = Test(value=1) t2 = Test(value=1) t3 = Test(value=1) s.add_all([t1, t2, t3]) s.commit() try: with s.begin_nested(): t1.value = 2 with s.begin_nested(): t2.value = 2 t3.value = 2 raise ValueError("x") except ValueError: assert (t1.value, t2.value, t3.value) == (1, 1, 1), (t1.value, t2.value, t3.value) else: assert False ``` it seems like the "_dirty" list on transaction is only populated in the subtransaction within the flush, so this never has a chance to propagate outwards on a successful commit. We will need to add something to SessionTransaction.commit() so that the subtransaction has a chance to propagate its dirty list to the parent. may be safe for a 0.9.10 backport. |
|
From: Sergii G. <iss...@bi...> - 2015-04-02 10:37:29
|
New issue 3351: outdated link in ORM documentation https://bitbucket.org/zzzeek/sqlalchemy/issue/3351/outdated-link-in-orm-documentation Sergii Golubev: There's an outdated link at the end of the section Explicit Join + Eagerload: http://docs.sqlalchemy.org/en/latest/orm/tutorial.html#explicit-join-eagerload ``` ... loading by default, see the section <no title>. ``` |
|
From: jvanasco <iss...@bi...> - 2015-04-01 22:47:07
|
New issue 3350: Feature Request - ScopedSession.session_factory as an API method https://bitbucket.org/zzzeek/sqlalchemy/issue/3350/feature-request jvanasco: I'm requesting that ScopedSession.session_factory become a public API method. This is currently implemented, but hidden and undocumented. Rationale / use-case: We have a transaction-safe PostgreSQL application. There exists some tasks that require a separate database connection to operate independent of the transaction (generally things like logging various bits of information, such as AmazonS3 Activity, Failures due to Ratelimits, some error logging). This is often handled with a separate database setup, but that was a bit painful to handle in a situation... and after a bit of poking around on the internals, it seems that this works: dbSessionAlternate = dbSession.session_factory() dbSessionAutocommit = dbSession.session_factory(autocommit = True) Originally I hoped that this would work, but they don't: dbSessionA = dbSession() dbSessionB = dbSession(autocommit = True) `dbSessionA` creates a new Session, but it's underlying connection is local to the scope/thead ( ie, dbSession.connection() == dbSessionA.connection() ) `dbSessionB` raises an error because it is trying to duplicate the 'scoped_session', not just the underlying session, |
|
From: Saif H. <iss...@bi...> - 2015-04-01 07:20:35
|
New issue 3349: _no_select_modifiers does not check for joins, which can result in dangerous behavior https://bitbucket.org/zzzeek/sqlalchemy/issue/3349/_no_select_modifiers-does-not-check-for Saif Hakim: I noticed that `_no_select_modifiers` and `_no_criterion_assertion` in `orm/query.py` differ only in checking `self._statement` and `self._from_obj`. It seems that `_no_criterion_assertion` should be equivalent to `self._statement is None and _no_select_modifiers`; it is surprising that `_from_obj` is omitted, as this can result in a very dangerous situation when doing bulk updates, since `_from_obj` is ignored entirely. For example, someone may mistakenly use a join instead of a filter: ``` (session.query(File) .join(File.folder) .filter(Folder.owner_id == 1) .update({'content': 'USER 1'}, synchronize_session=False)) ``` results in `UPDATE file SET content='USER 1' FROM folder WHERE folder.owner_id = 1` which will touch every file instead of just ones belong to user 1. The suggested fix is to add: `('_from_obj', 'join()', ())` in `_no_select_modifiers`, which will error, as demonstrated in attached file. |
|
From: Mike B. <iss...@bi...> - 2015-03-31 17:09:48
|
New issue 3348: loader options from non_primary mappers https://bitbucket.org/zzzeek/sqlalchemy/issue/3348/loader-options-from-non_primary-mappers Mike Bayer: e.g. query.options(joinedload_all("a.bs_np.c")), where "bs_np" refers to a non primary mapper. can't use getattr() here: ``` #!diff diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py index cb7a5fe..70f4caa 100644 --- a/lib/sqlalchemy/orm/strategy_options.py +++ b/lib/sqlalchemy/orm/strategy_options.py @@ -128,21 +128,24 @@ class Load(Generative, MapperOption): attr = "%s:%s" % (wildcard_key, attr) return path.token(attr) - try: - # use getattr on the class to work around - # synonyms, hybrids, etc. - attr = getattr(path.entity.class_, attr) - except AttributeError: - if raiseerr: - raise sa_exc.ArgumentError( - "Can't find property named '%s' on the " - "mapped entity %s in this Query. " % ( - attr, path.entity) - ) - else: - return None + if path.entity.non_primary: + attr = path.entity._props[attr] else: - attr = attr.property + try: + # use getattr on the class to work around + # synonyms, hybrids, etc. + attr = getattr(path.entity.class_, attr) + except AttributeError: + if raiseerr: + raise sa_exc.ArgumentError( + "Can't find property named '%s' on the " + "mapped entity %s in this Query. " % ( + attr, path.entity) + ) + else: + return None + else: + attr = attr.property path = path[attr] else: ``` this might apply to 0.9 as well. |
|
From: Gabor G. <iss...@bi...> - 2015-03-30 09:32:23
|
New issue 3347: 1.0.0b4: Eager-loading options result in wrong query https://bitbucket.org/zzzeek/sqlalchemy/issue/3347/100b4-eager-loading-options-result-in Gabor Gombas: Hi, The attached example runs fine with 0.9.7, but generates a wrong sub-select with 1.0.0b3: (SELECT dns_record_1.id AS dns_record_1_id, branch_1.id AS branch_1_id, branch_1.name AS branch_1_name FROM dns_record AS dns_record_1 JOIN branch AS branch_1 ON branch_1.id = host.branch_id, host) |
|
From: Sebastian E. <iss...@bi...> - 2015-03-30 08:30:58
|
New issue 3346: ellipses_string in langhelpers.py raises StatementError for non-string values https://bitbucket.org/zzzeek/sqlalchemy/issue/3346/ellipses_string-in-langhelperspy-raises Sebastian Elsner: Using 1.0b4. If "value" is not a string, this will raise an exception, which results in a StatementError, when happening in a flush. ``` #!python def ellipses_string(value, len_=25): if len(value) > len_: return "%s..." % value[0:len_] else: return value ``` using: ``` #!python if len(str(value)) > len_: ``` instead, fixes the problem for me, though I do not know if this is a good way. |
|
From: Thomas T. <iss...@bi...> - 2015-03-29 18:13:52
|
New issue 3345: Naming conventions example should use columns_0_name https://bitbucket.org/zzzeek/sqlalchemy/issue/3345/naming-conventions-example-should-use Thomas Tanner: The example http://docs.sqlalchemy.org/en/latest/core/constraints.html#configuring-constraint-naming-conventions ``` #!python convention = { "ix": 'ix_%(column_0_label)s', "uq": "uq_%(table_name)s_%(column_0_name)s", "ck": "ck_%(table_name)s_%(constraint_name)s", "fk": "fk_%(table_name)s_%(column_0_name)s_%(referred_table_name)s", "pk": "pk_%(table_name)s" } ``` should be changed to "ck": "ck_%(table_name)s_%(column_0_name)s", Otherwise unnamed constraints (for example, Boolean) raise sqlalchemy.exc.InvalidRequestError: Naming convention including %(constraint_name)s token requires that constraint is explicitly named. |
|
From: jvanasco <iss...@bi...> - 2015-03-27 22:17:27
|
New issue 3344: 1.0.0b3 is installed by easy_install / pip https://bitbucket.org/zzzeek/sqlalchemy/issue/3344/100b3-is-installed-by-easy_install-pip jvanasco: easy_install and pip are picking up 1.0.0b3 for fresh installs and upgrades. |
|
From: Jon N. <iss...@bi...> - 2015-03-24 15:07:22
|
New issue 3343: regression in supporting reflection on PostgreSQL 8.4 https://bitbucket.org/zzzeek/sqlalchemy/issue/3343/regression-in-supporting-reflection-on Jon Nelson: In ..../postgresql/base.py a change was made ( #3184, pull request bitbucket:30 ) to support additional smarts in reflecting indices and unique constraints in PostgreSQL. Unfortunately, this change is not compatible with PostgreSQL 8.4 which does not have a 'conindid' column. While it's not elegant, I whipped up the following patch: ``` #!C diff -ur SQLAlchemy-1.0.0b3.orig/lib/sqlalchemy/dialects/postgresql/base.py SQLAlchemy-1.0.0b3/lib/sqlalchemy/dialects/postgresql/base.py --- SQLAlchemy-1.0.0b3.orig/lib/sqlalchemy/dialects/postgresql/base.py 2015-03-24 09:51:23.850734852 -0500 +++ SQLAlchemy-1.0.0b3/lib/sqlalchemy/dialects/postgresql/base.py 2015-03-24 09:59:38.201019680 -0500 @@ -2605,7 +2605,7 @@ SELECT i.relname as relname, ix.indisunique, ix.indexprs, ix.indpred, - a.attname, a.attnum, c.conrelid, ix.indkey%s + a.attname, a.attnum, %s, ix.indkey%s FROM pg_class t join pg_index ix on t.oid = ix.indrelid @@ -2613,11 +2613,7 @@ left outer join pg_attribute a on t.oid = a.attrelid and %s - left outer join - pg_constraint c - on (ix.indrelid = c.conrelid and - ix.indexrelid = c.conindid and - c.contype in ('p', 'u', 'x')) + %s WHERE t.relkind IN ('r', 'v', 'f', 'm') and t.oid = :table_oid @@ -2629,8 +2625,14 @@ # version 8.3 here was based on observing the # cast does not work in PG 8.2.4, does work in 8.3.0. # nothing in PG changelogs regarding this. + "c.conrelid" if self.server_version_info >= (9, 0) else "NULL as conrelid", "::varchar" if self.server_version_info >= (8, 3) else "", - self._pg_index_any("a.attnum", "ix.indkey") + self._pg_index_any("a.attnum", "ix.indkey"), + """left outer join + pg_constraint c + on (ix.indrelid = c.conrelid and + ix.indexrelid = c.conindid and + c.contype in ('p', 'u', 'x'))""" if self.server_version_info >= (9, 0) else "" ) t = sql.text(IDX_SQL, typemap={'attname': sqltypes.Unicode}) ``` If you would prefer a pull request, I *might* be able to do that. |
|
From: thiefmaster <iss...@bi...> - 2015-03-24 13:43:48
|
New issue 3342: Add canonical urls to the documentation https://bitbucket.org/zzzeek/sqlalchemy/issue/3342/add-canonical-urls-to-the-documentation thiefmaster: Right now the google index for the SA documentation is a mess. Links to 0.7 or 0.8 are quite common, even though all links in the google index should point to the latest stable version. Readthedocs has an [option](http://docs.readthedocs.org/en/latest/canonical.html) to enable canonical urls, but it should be easy enough to do even without using RTD: https://support.google.com/webmasters/answer/139066?hl=en |
|
From: Gabor G. <iss...@bi...> - 2015-03-24 09:24:21
|
New issue 3341: 1.0.0b3: regression with single-table inheritance and constraint added in a subclass https://bitbucket.org/zzzeek/sqlalchemy/issue/3341/100b3-regression-with-single-table Gabor Gombas: Hi, The attached example works fine with 0.9.7, but 1.0.0b3 gives the following error: `sqlalchemy.exc.ArgumentError: Can't add unnamed column to column collection` Gabor |
|
From: Mike B. <iss...@bi...> - 2015-03-23 16:21:28
|
New issue 3340: label ordering rules intended for eager loading get in the way of valid use cases https://bitbucket.org/zzzeek/sqlalchemy/issue/3340/label-ordering-rules-intended-for-eager Mike Bayer: ``` #!diff diff --git a/test/sql/test_text.py b/test/sql/test_text.py index 4483597..1c3cb0c 100644 --- a/test/sql/test_text.py +++ b/test/sql/test_text.py @@ -574,6 +574,15 @@ class OrderByLabelResolutionTest(fixtures.TestBase, AssertsCompiledSQL): "FROM mytable AS mytable_1 ORDER BY mytable_1.name" ) + def test_order_by_named_label_from_anon_label(self): + s1 = select([table1.c.myid.label(None).label("foo"), table1.c.name]) + stmt = s1.order_by("foo") + self.assert_compile( + stmt, + "SELECT mytable.myid AS foo, mytable.name " + "FROM mytable ORDER BY foo" + ) + def test_order_by_outermost_label(self): # test [ticket:3335], assure that order_by("foo") # catches the label named "foo" in the columns clause only, ``` fails: ``` #! File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/util/langhelpers.py", line 1307, in warn_limited warnings.warn(msg, exc.SAWarning, stacklevel=2) SAWarning: Can't resolve label reference 'foo'; converting to text() (this warning may be suppressed after 10 occurrences) ``` because of this: ``` #!diff diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index 7d64c2c..db759eb 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -3040,6 +3040,8 @@ class Label(ColumnElement): if name: self.name = name + # shouldn't we do this?? + # self._resolve_label = name else: self.name = _anonymous_label( '%%(%d %s)s' % (id(self), getattr(element, 'name', 'anon')) ``` but doing "that" fails because test_columnadapter_anonymized is testing exactly that this label is no longer targetable. But we have this situation for a column_property() and this should not fail: ``` #!python from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class EMap(Base): __tablename__ = 'a' id = Column(Integer, primary_key=True) FName = Column(String(length=45)) LName = Column(String(length=45)) AssociateName = column_property(FName + " " + LName) s = Session() print s.query(EMap.AssociateName.label('foo')).group_by("foo") ``` |
|
From: Wichert A. <iss...@bi...> - 2015-03-23 15:07:47
|
New issue 3339: AddConstraint example fails with binding error https://bitbucket.org/zzzeek/sqlalchemy/issue/3339/addconstraint-example-fails-with-binding Wichert Akkerman: In order to support mark a constraint as deferrable with dialects that support it I use this code: ```python def deferrable_supported(ddl, target, bind, **kw): """Check if deferrable constraints are supported. This function can be used as a callable for :ref:`execute_if <sqlalchemy:sqlalchemy.schema.DDLElement.execute_if>` to only run DDL statements on databases that support deferrable constraints. """ return bind.dialect.name == 'postgresql' def deferrable_not_supported(ddl, target, bind, **kw): """Check if deferrable constraints are not supported. This function can be used as a callable for :ref:`execute_if <sqlalchemy:sqlalchemy.schema.DDLElement.execute_if>` to only run DDL statements on databases that do not support deferrable constraints. """ return bind.dialect.name not in ('postgresql', 'sqlite') for constraint in _generic_sku_constraints: listen(SKU.__table__, 'after_create', schema.AddConstraint(constraint) .execute_if(callable_=deferrable_not_supported)) for constraint in _deferrable_sku_constraints: listen(SKU.__table__, 'after_create', schema.AddConstraint(constraint) .execute_if(callable_=deferrable_supported)) ``` This code is modeled on the example in the [DDL chapter](http://docs.sqlalchemy.org/en/rel_0_9/core/ddl.html). This code fails with SQLAlchemy 0.9 with a `InvalidRequestError: This constraint is not bound to a table. Did you mean to call table.append_constraint(constraint) ?` error. |
|
From: petergrace <iss...@bi...> - 2015-03-23 14:56:47
|
New issue 3338: Change from 0.9.9 to 1.0.0b1 introduces syntax change that MSSQL does not appreciate https://bitbucket.org/zzzeek/sqlalchemy/issue/3338/change-from-099-to-100b1-introduces-syntax petergrace: I posted a stackoverflow question about this and someone mentioned I should also post the issue here since 1.0.0 is still in beta. You can see the nicely-formatted post here: http://stackoverflow.com/questions/29212205/in-sqlalchemy-group-by-on-column-property-no-longer-works-in-1-0-0b1 Here's a dump of the text of that question: A change from 0.9.9 to 1.0.0b1 in the query functionality is causing me some heartburn. I have a group_by clause that uses a column_property. In 0.9.9, the generated query reproduces the calculated value in GROUP BY by actually calculating the value again. In 1.0.0b1, the calculation is wrapped in an anon_1, and MSSQL won't let you group_by a named value for a calculated field. Is there some way to revert to the old behavior without requiring a specific version? The below code generates the following SQL in 0.9.7: SELECT count(cdr_extended.[UniqueID]) AS [CallCount], sum(cdr_extended.[Duration]) AS [TotalSeconds], ext_map.[FName] + ' ' + ext_map.[LName] AS anon_1 FROM cdr_extended, ext_map WHERE (ext_map.exten = cdr_extended.[Extension] OR ext_map.prev_exten = cdr_extended.[Extension]) AND cdr_extended.[StartTime] > '2015-01-01' AND cdr_extended.[Extension] IN ('8297') GROUP BY ext_map.[FName] + ' ' + ext_map.[LName] DESC However, in 1.0.0, it produces this code: SELECT count(cdr_extended.[UniqueID]) AS [CallCount], sum(cdr_extended.[Duration]) AS [TotalSeconds], ext_map.[FName] + ' ' + ext_map.[LName] AS anon_1 FROM cdr_extended, ext_map WHERE (ext_map.exten = cdr_extended.[Extension] OR ext_map.prev_exten = cdr_extended.[Extension]) AND cdr_extended.[StartTime] > '2015-01-01' AND cdr_extended.[Extension] IN ('8297') GROUP BY anon_1 DESC Here's the model: class EMap(Base): FName = Column(String(length=45)) LName = Column(String(length=45)) AssociateName = column_property(FName + " " + LName) The code in question: DBSession.query(func.count(ExtendedCDR.UniqueID) .label("CallCount"),func.sum(ExtendedCDR.Duration) .label("TotalSeconds")) .filter(or_(ExtensionMap.exten == ExtendedCDR.Extension,ExtensionMap.prev_exten == ExtendedCDR.Extension)) .filter(ExtendedCDR.StartTime>jan1) .filter(ExtendedCDR.Extension.in_(extensions)) .group_by(ExtensionMap.AssociateName) .order_by(func.count(ExtendedCDR.UniqueID).desc()) And finally, here's the actual stack trace when the group_by fails: Traceback (most recent call last): File "/usr/local/lib/python2.7/site-packages/pyramid_exclog-0.7-py2.7.egg/pyramid_exclog/__init__.py", line 111, in exclog_tween return handler(request) File "/usr/local/lib/python2.7/site-packages/pyramid-1.5.4-py2.7.egg/pyramid/router.py", line 163, in handle_request response = view_callable(context, request) File "/usr/local/lib/python2.7/site-packages/pyramid-1.5.4-py2.7.egg/pyramid/config/views.py", line 245, in _secured_view return view(context, request) File "/usr/local/lib/python2.7/site-packages/pyramid-1.5.4-py2.7.egg/pyramid/config/views.py", line 355, in rendered_view result = view(context, request) File "/usr/local/lib/python2.7/site-packages/pyramid-1.5.4-py2.7.egg/pyramid/config/views.py", line 501, in _requestonly_view response = view(request) File "/opt/cedar/cedar/views/ViewMyDashboard.py", line 51, in MyDashboardView YearList = ObstinateDatabaseQueryAll(DBSession.query(func.count(ExtendedCDR.UniqueID).label("CallCount"),func.sum(ExtendedCDR.Duration).label("TotalSeconds"),ExtensionMap.AssociateName).filter(or_(ExtensionMap.exten == ExtendedCDR.Extension,ExtensionMap.prev_exten == ExtendedCDR.Extension)).filter(ExtendedCDR.StartTime>year_today).filter(ExtendedCDR.Extension.in_(extensions)).group_by(ExtensionMap.AssociateName).order_by(func.count(ExtendedCDR.UniqueID).desc())) File "/opt/cedar/cedar/controllers/db.py", line 40, in ObstinateDatabaseQueryAll ret=query.all() File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2408, in all return list(self) File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2525, in __iter__ return self._execute_and_instances(context) File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/query.py", line 2540, in _execute_and_instances result = conn.execute(querycontext.statement, self._params) File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 914, in execute return meth(self, multiparams, params) File "build/bdist.linux-x86_64/egg/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement compiled_sql, distilled_params File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1146, in _execute_context context) File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1332, in _handle_dbapi_exception exc_info File "build/bdist.linux-x86_64/egg/sqlalchemy/util/compat.py", line 199, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/base.py", line 1139, in _execute_context context) File "build/bdist.linux-x86_64/egg/sqlalchemy/engine/default.py", line 442, in do_execute cursor.execute(statement, parameters) ProgrammingError: (pyodbc.ProgrammingError) ('42S22', "[42S22] [FreeTDS][SQL Server]Invalid column name 'anon_1'. (207) (SQLExecDirectW)") [SQL: 'SELECT count(cdr_extended.[UniqueID]) AS [CallCount], sum(cdr_extended.[Duration]) AS [TotalSeconds], ext_map.[FName] + ? + ext_map.[LName] AS anon_1 \nFROM cdr_extended, ext_map \nWHERE (ext_map.exten = cdr_extended.[Extension] OR ext_map.prev_exten = cdr_extended.[Extension]) AND cdr_extended.[StartTime] > ? AND cdr_extended.[Extension] IN (?) GROUP BY anon_1 ORDER BY count(cdr_extended.[UniqueID]) DESC'] [parameters: (' ', datetime.datetime(2015, 1, 1, 0, 0), '8297')] |
|
From: Mike B. <iss...@bi...> - 2015-03-22 22:50:49
|
New issue 3337: pymysql unicode expects unicode or non-unicode for statement/binds at the same time https://bitbucket.org/zzzeek/sqlalchemy/issue/3337/pymysql-unicode-expects-unicode-or-non Mike Bayer: we can set supports_unicode_statements and supports_unicode_binds to True or False and PyMySQL tests pass from 0.4 to 0.6.6. However, if statements is True and binds is False as it is right now, then the "executemany" tests fail, b.c. pymysql is generally using string interpolation to produce the string. Stack is as follows: ``` #! $ python -m pytest test/dialect/test_suite.py --dburi "mysql+pymysql://scott:tiger@localhost/test?charset=utf8" -k UnicodeVarcharTest ===================================================================== test session starts ====================================================================== platform darwin -- Python 2.7.5 -- py-1.4.26 -- pytest-2.6.4 -- /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python plugins: cov, xdist collected 143 items test/dialect/test_suite.py <- lib/sqlalchemy/testing/suite/test_types.py::UnicodeVarcharTest_mysql_pymysql::test_empty_strings_varchar PASSED test/dialect/test_suite.py <- lib/sqlalchemy/testing/suite/test_types.py::UnicodeVarcharTest_mysql_pymysql::test_literal PASSED test/dialect/test_suite.py <- lib/sqlalchemy/testing/suite/test_types.py::UnicodeVarcharTest_mysql_pymysql::test_round_trip PASSED test/dialect/test_suite.py <- lib/sqlalchemy/testing/suite/test_types.py::UnicodeVarcharTest_mysql_pymysql::test_round_trip_executemany FAILED =========================================================================== FAILURES =========================================================================== _________________________________________________ UnicodeVarcharTest_mysql_pymysql.test_round_trip_executemany _________________________________________________ Traceback (most recent call last): File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/testing/suite/test_types.py", line 89, in test_round_trip_executemany for i in range(3) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 1978, in execute return connection.execute(statement, *multiparams, **params) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 914, in execute return meth(self, multiparams, params) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection return connection._execute_clauseelement(self, multiparams, params) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement compiled_sql, distilled_params File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 1146, in _execute_context context) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 1335, in _handle_dbapi_exception util.reraise(*exc_info) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 1116, in _execute_context context) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/dialects/mysql/mysqldb.py", line 95, in do_executemany rowcount = cursor.executemany(statement, parameters) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymysql/cursors.py", line 148, in executemany self._get_db().encoding) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pymysql/cursors.py", line 162, in _do_execute_many v = values % escape(next(args), conn) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 64: ordinal not in range(128) =================================================================== short test summary info ==================================================================== FAIL test/dialect/test_suite.py::UnicodeVarcharTest_mysql_pymysql::()::test_round_trip_executemany ======================================================== 139 tests deselected by '-kUnicodeVarcharTest' ======================================================== ====================================================== 1 failed, 3 passed, 139 deselected in 0.27 seconds ====================================================== classics-MacBook-Pro:sqlalchemy classic$ ``` the fix works all the way back for pymysql 0.4 which was five years ago so this is good for 0.9. |
|
From: Mike B. <iss...@bi...> - 2015-03-21 17:44:42
|
New issue 3336: mysqlconnector + py3k and encodings https://bitbucket.org/zzzeek/sqlalchemy/issue/3336/mysqlconnector-py3k-and-encodings Mike Bayer: ``` #! python3 -m pytest test/dialect/mysql/test_dialect.py --db mysqlconnector -k test_special_encodings ================================================ test session starts ================================================ platform darwin -- Python 3.4.2 -- py-1.4.26 -- pytest-2.5.2 -- /usr/local/bin/python3 collected 11 items test/dialect/mysql/test_dialect.py:89: DialectTest_mysql_mysqlconnector.test_special_encodings FAILED ===================================================== FAILURES ====================================================== ______________________________ DialectTest_mysql_mysqlconnector.test_special_encodings ______________________________ Traceback (most recent call last): File "<string>", line 2, in test_special_encodings File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/testing/exclusions.py", line 95, in decorate return self._do(config._current, fn, *args, **kw) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/testing/exclusions.py", line 124, in _do self._expect_failure(config, ex, name=fn.__name__) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/testing/exclusions.py", line 136, in _expect_failure util.raise_from_cause(ex) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/util/compat.py", line 188, in raise_from_cause reraise(type(exception), exception, tb=exc_tb, cause=exc_value) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/util/compat.py", line 182, in reraise raise value File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/testing/exclusions.py", line 122, in _do return_value = fn(*args, **kw) File "/Users/classic/dev/sqlalchemy/test/dialect/mysql/test_dialect.py", line 96, in test_special_encodings conn = eng.connect() File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 2005, in connect return self._connection_cls(self, **kwargs) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 72, in __init__ if connection is not None else engine.raw_connection() File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 2091, in raw_connection self.pool.unique_connection, _connection) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py", line 2061, in _wrap_pool_connect return fn() File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 279, in unique_connection return _ConnectionFairy._checkout(self) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 644, in _checkout fairy = _ConnectionRecord.checkout(pool) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 439, in checkout rec = pool._do_get() File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 964, in _do_get self._dec_overflow() File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/util/langhelpers.py", line 60, in __exit__ compat.reraise(exc_type, exc_value, exc_tb) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/util/compat.py", line 182, in reraise raise value File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 961, in _do_get return self._create_connection() File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 284, in _create_connection return _ConnectionRecord(self) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/pool.py", line 415, in __init__ exec_once(self.connection, self) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/event/attr.py", line 248, in exec_once self(*args, **kw) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/event/attr.py", line 258, in __call__ fn(*args, **kw) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/util/langhelpers.py", line 1319, in go return once_fn(*arg, **kw) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/engine/strategies.py", line 157, in first_connect dialect.initialize(c) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/dialects/mysql/base.py", line 2578, in initialize self._detect_ansiquotes(connection) File "/Users/classic/dev/sqlalchemy/lib/sqlalchemy/dialects/mysql/base.py", line 2857, in _detect_ansiquotes self._server_ansiquotes = 'ANSI_QUOTES' in mode TypeError: Type str doesn't support the buffer API ============================================== short test summary info ============================================== FAIL test/dialect/mysql/test_dialect.py::DialectTest_mysql_mysqlconnector::()::test_special_encodings ================================= 10 tests deselected by '-ktest_special_encodings' ================================= ====================================== 1 failed, 10 deselected in 0.04 ``` |
|
From: jvanasco <iss...@bi...> - 2015-03-20 23:18:23
|
New issue 3335: ordering by a label present in an `alias` will create an invalid query https://bitbucket.org/zzzeek/sqlalchemy/issue/3335/ordering-by-a-label-present-in-an-alias jvanasco: this is a new issue with 1.0.0b2 and Postgres. i am not sure if other databases will fail. this is a bit of an confusing to describe, so bear with me. i made an example, but it is confusing too! https://gist.github.com/jvanasco/986c30d91095cef5526f the issue is in the interplay of aliased columns and an "ORDER BY" If the ordering column's name is the same as a column name in the aliased "select", then an ordering will be applied to the column in the aliased select -- which breaks a GROUP BY. if the column name is not in the aliased select, then the ordering will be generated as a bareword -- which is the valid query. * query_form_a this worked in 0.9.9, it does not work in 1.0.0b2 line 100 applies a 'event_timestamp' label over the 'event_timestamp' column. line 110 sorts on 'event_timestamp' This will output 0.9.9 `ORDER BY event_timestamp DESC` 1.0.0b2 `ORDER BY q_stream.event_timestamp DESC` * query form b this did not work in 0.9.9 and does not work in 1.0.0b2 just shown for comparison line 137 we select an 'event_timestamp' column line 147 sorts on 'event_timestamp' * query form c this works on 0.9.9 and 1.0.0b2 however it requires a column renaming line 174 we select the 'event_timestamp' column and rename it 'timestamp_renamed' line 184 sorts on 'timestamp_renamed' This will output 0.9.9 `ORDER BY timestamp_renamed DESC` 1.0.0b2 `ORDER BY timestamp_renamed DESC` note: i used the following sqlalchemy connection string so it would hit the DB and raise the query exceptions for postgres. i found that easier than inspecting the sql in a memory engine. user - sqlalchemy_test password - sqla database - sqlalchemy_test |
|
From: Leonardo R. <iss...@bi...> - 2015-03-20 13:44:56
|
New issue 3334: Wrong quoting in PostgreSQL query https://bitbucket.org/zzzeek/sqlalchemy/issue/3334/wrong-quoting-in-postgresql-query Leonardo Rossi: I have a problem with sql quoting on this query: ```python database_user = "test\"quo'te" engine.execute("""SELECT 1 FROM pg_roles WHERE rolname='%s'""", database_user) ``` Traceback: ``` Traceback (most recent call last): File "/home/vagrant/.virtualenvs/invenio2/bin/inveniomanage", line 9, in <module> load_entry_point('invenio==2.1.0.dev20150305', 'console_scripts', 'inveniomanage')() File "/home/vagrant/.virtualenvs/invenio2/src/invenio/invenio/base/manage.py", line 103, in main manager.run() File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/flask_script/__init__.py", line 412, in run result = self.handle(sys.argv[0], sys.argv[1:]) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/flask_script/__init__.py", line 383, in handle res = handle(*args, **config) File "/home/vagrant/.virtualenvs/invenio2/src/invenio/invenio/ext/script/__init__.py", line 148, in __call__ res = super(SignalingCommand, self).__call__(*args, **kwargs) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/flask_script/commands.py", line 216, in __call__ return self.run(*args, **kwargs) File "/home/vagrant/.virtualenvs/invenio2/src/invenio/invenio/base/scripts/database.py", line 93, in init database_pass=current_app.config['CFG_DATABASE_PASS'], File "/home/vagrant/.virtualenvs/invenio2/src/invenio/invenio/ext/sqlalchemy/utils.py", line 387, in initialize_database_user database_user) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1751, in execute return connection.execute(statement, *multiparams, **params) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 721, in execute return self._execute_text(object, multiparams, params) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 870, in _execute_text statement, parameters File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 958, in _execute_context context) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1159, in _handle_dbapi_exception exc_info File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause reraise(type(exception), exception, tb=exc_tb) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 951, in _execute_context context) File "/home/vagrant/.virtualenvs/invenio2/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 436, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.ProgrammingError: (ProgrammingError) syntax error at or near "test" LINE 1: SELECT 1 FROM pg_roles WHERE rolname=''test"quo''te'' ^ "SELECT 1 FROM pg_roles WHERE rolname='%s'" (u'test"quo\'te',) ``` |
|
From: Mike B. <iss...@bi...> - 2015-03-18 21:24:58
|
New issue 3333: mysql BIT broken in py3k https://bitbucket.org/zzzeek/sqlalchemy/issue/3333/mysql-bit-broken-in-py3k Mike Bayer: https://github.com/zzzeek/sqlalchemy/pull/158 tenative milestone for 0.9.10 |
|
From: Mike B. <iss...@bi...> - 2015-03-18 21:23:18
|
New issue 3332: autocommit for mysql drivers https://bitbucket.org/zzzeek/sqlalchemy/issue/3332/autocommit-for-mysql-drivers Mike Bayer: https://github.com/zzzeek/sqlalchemy/pull/157/ |