mysql 无论里面的代码如何,交易都会失败
mysql transaction fails regardless of the code inside
我正在尝试在 mySQL 中编写交易,但无论我在标签之间放置什么,我都会出错。
start transaction;
set @email = "FOO";
PRINT @email;
commit;
这个块总是产生错误:
SQL Error [1064] [42000]: 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 'set @email_name = "FOO";
PRINT @email_name;
commit' at line 2
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'set @email_name = "FOO";
PRINT @email_name;
commit' at line 2
无论在事务中放置什么代码,这种行为都会发生,如果没有注意到,甚至会持续存在。
没有打印,请使用SELECT。
我正在尝试在 mySQL 中编写交易,但无论我在标签之间放置什么,我都会出错。
start transaction;
set @email = "FOO";
PRINT @email;
commit;
这个块总是产生错误:
SQL Error [1064] [42000]: 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 'set @email_name = "FOO";
PRINT @email_name;
commit' at line 2
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'set @email_name = "FOO";
PRINT @email_name;
commit' at line 2
无论在事务中放置什么代码,这种行为都会发生,如果没有注意到,甚至会持续存在。
没有打印,请使用SELECT。