Skip to content

Sequence are wrongly created for MariaDB when using cycle=False #13073

@rusher

Description

@rusher

Describe the bug

Sequence are wrongly created for MariaDB when using cycle=False, creating SQL like
"CREATE SEQUENCE ab_permission_id_seq INCREMENT BY 1 START WITH 1 MINVALUE 1 NO CYCLE"
resulting in Error
sqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CYCLE' at line 1")

A PR will be created just after, just ignoring cycle=False (like cycle=None) for MariaDB

Optional link from https://docs.sqlalchemy.org which documents the behavior that is expected

No response

SQLAlchemy Version in Use

2.0.45

DBAPI (i.e. the database driver)

pymysql

Database Vendor and Major Version

MariaDB 12.2

Python Version

3.11

Operating system

ubuntu

To Reproduce

from sqlalchemy import Sequence

class User(Base):
    __tablename__ = 'users'

    id = Column(Integer, Sequence('user_id_seq', cycle=False), primary_key=True)
    name = Column(String(50))
    email = Column(String(100))

Error

# Copy the complete stack trace and error message here, including SQL log output if applicable.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    mariadbschemathings related to the DDL related objects like Table, Column, CreateIndex, etc.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions