I'm testing this on SQLAlchemy 0.7.1, oursql 0.9.2, MySQL 5.5.13 on
Mac OS X 10.6.7
Here's my test script:
from sqlalchemy import create_engine, Column, Integer, Unicode
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
Base = declarative_base()
class User(Base):
__tablename__ = 'user'
id = Column(Integer, autoincrement=True, primary_key=True)
name = Column(Unicode(128), nullable=False, unique=True)
class Address(Base):
__tablename__ = 'address'
id = Column(Integer, autoincrement=True, primary_key=True)
address = Column(Unicode(128), nullable=False, unique=True)
engine = create_engine("mysql+oursql://tester:tester@localhost/
test_hometasty?charset=utf8")
engine_bindings = {User: engine, Address: engine}
User.metadata.create_all(engine)
Address.metadata.create_all(engine)
Session = scoped_session(sessionmaker(twophase=True))
Session.configure(binds=session_bindings)
Session.configure(binds=engine_bindings)
session = Session()
alice = User(name=u"alice")
session.add(alice)
hk = Address(address=u"Hong Kong")
session.add(hk)
session.commit()
Here's the error I get:
sqlalchemy.exc.ProgrammingError: (ProgrammingError) (1064, 'You have
an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near
\'"_sa_7fd8e09924568e2e2a653185227c2929"\' at line 1', None) 'XA BEGIN
"_sa_7fd8e09924568e2e2a653185227c2929"' ()
Am I doing something wrong or is this a bug?
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en.