Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

特殊情况下 insert_id获得的ID 为0 #1

Open
pytomtoto opened this issue Apr 29, 2019 · 0 comments
Open

特殊情况下 insert_id获得的ID 为0 #1

pytomtoto opened this issue Apr 29, 2019 · 0 comments

Comments

@pytomtoto
Copy link

pytomtoto commented Apr 29, 2019

特殊情况下 insert_id获得的ID 为0
Data truncated for column 'description' at row 1
Data truncated for column 'closed_at' at row 1

pymysql通过游标获取ID无此情况

def execute_insert(sql):
    try:
        with connection.cursor() as cursor:
            cursor.execute(sql)
        connection.commit()
        return cursor.lastrowid
    except Exception as e:
        logger.error(sql)
        logger.error(traceback.format_exc())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant