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

please support savepoint #6840

Closed
aesirteam opened this issue Jun 14, 2018 · 23 comments · Fixed by #34466
Closed

please support savepoint #6840

aesirteam opened this issue Jun 14, 2018 · 23 comments · Fixed by #34466
Assignees
Labels
feature/accepted This feature request is accepted by product managers type/compatibility type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@aesirteam
Copy link

aesirteam commented Jun 14, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
START TRANSACTION;
SELECT 1 FROM dual;
SAVEPOINT save1;
SELECT 1 FROM dual;
ROLLBACK TO SAVEPOINT save1;
COMMIT;
  1. What did you expect to see?

All statements succeed.

  1. What did you see instead?
mysql> START TRANSACTION;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT 1 FROM dual;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql> SAVEPOINT save1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 9 near "SAVEPOINT save1" 
mysql> SELECT 1 FROM dual;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

mysql> ROLLBACK TO SAVEPOINT save1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 11 near "TO SAVEPOINT save1" 
mysql> COMMIT;
Query OK, 0 rows affected (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    Release Version: v2.1.0-alpha-48-ge2c8c4e
    Git Commit Hash: e2c8c4e
    Git Branch: master
    UTC Build Time: 2018-06-13 12:05:19
    GoVersion: go version go1.10.2 linux/amd64
    Race Enabled: false
    TiKV Min Version: 2.1.0-alpha.1-c4133d3ef0f099f8716a916c198390b26293ec00
@zimulala
Copy link
Contributor

@aesirteam
We don't support savepoint, and it isn't on our roadmap now.

@breezewish
Copy link
Member

Duplicate with #3663

@muyu66
Copy link

muyu66 commented Jul 4, 2018

Why don't support? I think it's important to implement Sequelize's Callback transaction

@lysu
Copy link
Contributor

lysu commented Jul 4, 2018

@muyu66 yes, savepoint is a very useful feature, it's not on our short-term roadmap, but we maybe try to implement that in future, and welcome to contribute too~

morgo added a commit to pingcap/docs that referenced this issue Oct 19, 2018
Add Savepoints, via: pingcap/tidb#6840

Clarify it is fulltext indexes + functions
And spatial indexes + functions

Add non binary collations
ngaut pushed a commit to pingcap/docs that referenced this issue Oct 19, 2018
Add Savepoints, via: pingcap/tidb#6840

Clarify it is fulltext indexes + functions
And spatial indexes + functions

Add non binary collations
@ihipop
Copy link

ihipop commented Mar 6, 2019

@lysu pingcap/docs#682 this pull just add the compatibility of savepoint,not the function implementation of savepoint,is it right?

@lysu
Copy link
Contributor

lysu commented Mar 6, 2019

@ihipop , yes , savepoint isn't supported until now..

@chris-ng-scmp
Copy link

Good to see if savepoint can be supported

@breezewish breezewish added the type/feature-request Categorizes issue or PR as related to a new feature. label Aug 6, 2020
@zz-jason zz-jason added the feature/reviewing This feature request is reviewing by product managers label Aug 10, 2020
@zz-jason zz-jason added feature/accepted This feature request is accepted by product managers and removed feature/reviewing This feature request is reviewing by product managers labels Aug 28, 2020
@scsldb scsldb added this to the Requirement pool milestone Aug 28, 2020
@wuwangben
Copy link

Is there a plan to support savepoint?

@wzru
Copy link
Contributor

wzru commented Aug 16, 2021

Recently when I test GORM and TiDB compatibility (inspired by #24194)
GORM tests failed because TiDB has not supported SAVEPOINT:

2021/08/16 11:14:38 gorm.io/driver/mysql@v1.1.1/mysql.go:330 
Error 1064: You have an error in your SQL syntax; 
check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 11 near "TO SAVEPOINT save_point1"
[0.190ms] [rows:0] ROLLBACK TO SAVEPOINT save_point1
--- FAIL: TestTransactionWithSavePoint (0.01s)
    transaction_test.go:193: Should not find rollbacked record

With SAVEPOINT supported, TiDB will also be more compatible with GORM.

@bb7133
Copy link
Member

bb7133 commented Aug 16, 2021

@wzru Yes, savepoint is on the roadmap, thanks!

@Allan-Nava
Copy link

Any news?

@xujiajun
Copy link

+1

@cjphaha
Copy link

cjphaha commented Apr 19, 2022

Is it supported now?

@crazycs520
Copy link
Contributor

I will work on this now

@crazycs520 crazycs520 self-assigned this Apr 22, 2022
@cjphaha
Copy link

cjphaha commented Apr 30, 2022

I will work on this now

Hi bro, is it convenient to ask? Which version supports savepoint?

@crazycs520
Copy link
Contributor

I will work on this now

Hi bro, is it convenient to ask? Which version supports savepoint?

If it goes well, savepoint may be supported in TiDB v6.2.0.

@mstao
Copy link

mstao commented Jun 20, 2022

+1, Seata needs the support of saveponit. ROLLBACK TO SAVEPOINT

@fishfree
Copy link

@crazycs520 I notice v6.2.0 just released, is the feature SAVEPOINT added in it?

@xhebox
Copy link
Contributor

xhebox commented Aug 24, 2022

@crazycs520 I notice v6.2.0 just released, is the feature SAVEPOINT added in it?

Yes. You could check release notes here. It seems that github release notes are not completed.

@HashJang
Copy link

Since savepoint is implemented, why is it still stated that in the document:

@transactional(propagation = Propagation.NESTED) is not supported

@Icemap
Copy link
Member

Icemap commented Nov 10, 2022

Since savepoint is implemented, why is it still stated that in the document:
@transactional(propagation = Propagation.NESTED) is not supported

@HashZhang Nice catch! I'll update develop guide ASAP.

@Icemap
Copy link
Member

Icemap commented Nov 10, 2022

Actually, I already updated the Choose Driver or ORM doc.
So, as we talked before. Maybe cheery-pick this PR to all versions is a good idea? @Oreoxmt PTAL

image

@Oreoxmt
Copy link

Oreoxmt commented Nov 10, 2022

Actually, I already updated the Choose Driver or ORM doc. So, as we talked before. Maybe cheery-pick this PR to all versions is a good idea? @Oreoxmt PTAL

image

This note has been added to v6.1 and later versions. https://docs.pingcap.com/tidb/stable/dev-guide-choose-driver-or-orm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/accepted This feature request is accepted by product managers type/compatibility type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.