if __name__ == "__main__": actions = '' for i in range(10): # 修改长度进行测试 actions += "SY" insert(Length(actions=actions)) del_table()
出现报错:
1 2 3 4
sqlalchemy.exc.DataError: (pymysql.err.DataError) (1406, "Data too long for column 'actions' at row 1") [SQL: INSERT INTO string_length (actions) VALUES (%(actions)s)] [parameters: {'actions': 'SYSYSYSYSYSYSYSYSYSY'}] (Background on this error at: https://sqlalche.me/e/14/9h9h)