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

DBLE能否兼容设置隔离级别时不加session关键字 #3004

Open
gyshen5206 opened this issue Dec 14, 2021 · 4 comments
Open

DBLE能否兼容设置隔离级别时不加session关键字 #3004

gyshen5206 opened this issue Dec 14, 2021 · 4 comments
Labels
community issue from community

Comments

@gyshen5206
Copy link

  • dble version:dble-3.21.10.0-97a3b6d73a49cb374020f930c59f82746220b424-20211119064810
  • preconditions :
    no
  • configs:
    ** user.xml**
    <managerUser name="man1" password="654321" maxCon="100"/>
    <shardingUser name="sgy" password="admin" schemas="sbtest,testdb,tdb" readOnly="false"  maxCon="200"/>
  • steps:
    step1.
[root@server_4 ~]#  mysql -usgy -padmin -h 10.186.65.4 -P 8066
mysql> \s
--------------
mysql  Ver 14.14 Distrib 5.7.25, for linux-glibc2.12 (x86_64) using  EditLine wrapper

Connection id:		3
Current database:	db_1
Current user:		[email protected]
SSL:			Not in use
Current pager:		stdout
Using outfile:		''
Using delimiter:	;
Server version:		5.7.11-dble-3.21.10.0-97a3b6d73a49cb374020f930c59f82746220b424-20211119064810 dble Server (ActionTech)
Protocol version:	10
Connection:		10.186.65.4 via TCP/IP
Server characterset:	utf8mb4
Db     characterset:	utf8mb4
Client characterset:	utf8
Conn.  characterset:	utf8
TCP port:		8066
--------------

  • expect result:
    1.
  • real result:
    1.
mysql> SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;    //不加session关键字,则执行报错,需要兼容
ERROR 1064 (HY000): setting transaction without any SESSION or GLOBAL keyword is not supported now
mysql> SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;   //添加session关键字后,可以正常运行
Query OK, 0 rows affected (0.00 sec)

需要帮忙兼容的原因是,通过.net框架生成的SQL为:SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;  暂未能添加session关键字
@PanternBao
Copy link
Member

Use like this?
image

@gyshen5206
Copy link
Author

mysql> \s

mysql Ver 14.14 Distrib 5.7.25, for linux-glibc2.12 (x86_64) using EditLine wrapper

Connection id: 6723
Current database:
Current user: sgy@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.7.25-log MySQL Community Server (GPL)
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /data/mysql/data/3309/mysqld.sock
Uptime: 1 day 23 hours 11 min 36 sec

Threads: 29 Questions: 3513225 Slow queries: 110 Opens: 4800 Flush tables: 2 Open tables: 1600 Queries per second avg: 20.678

mysql> SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
Query OK, 0 rows affected (0.00 sec)

MySQL原生是支持设置事务隔离级别时不指定SESSION的写法,DBLE应该也支持。
DBLE为何允许不加session,主要影响是什么?

@PanternBao
Copy link
Member

加session和不加session的语义是不一样的,具体可以参考:https://dev.mysql.com/doc/refman/8.0/en/set-transaction.html

在分布式的场景下,不加session的场景对于dble来说不易处理,因此,dble对不加session的场景是禁止的。

@gyshen5206
Copy link
Author

好的,谢谢!

@yanhuqing666 yanhuqing666 added the community issue from community label Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community issue from community
Projects
None yet
Development

No branches or pull requests

3 participants