Comments (10)
from lealone.
通过alter sequence语句修改sequence后产生新的版本,但是跟字段关联的sequence却是老版本,所以无法使用新修改的值
问题已修复,感谢报告bug。
from lealone.
你是从哪里知道 (next value for myseq) 这种冷门的用法,并且用的还是 system 自动生成的内部 sequence。
from lealone.
你是从哪里知道 (next value for myseq) 这种冷门的用法,并且用的还是 system 自动生成的内部 sequence。
from lealone.
可以这样改SEQ吗
update INFORMATION_SCHEMA.SEQUENCES set CURRENT_VALUE = 1549 where SEQUENCE_NAME = 'SYSTEM_SEQUENCE_EE1F314E_25F9_4CAA_8E30_C2F8B83C8C69'
from lealone.
不建议直接使用 system sequence
你可以这样使用:
create sequence if not exists myseq;
create table mytable(f1 int default (next value for myseq), f2 int);
修改 sequence 只能用 alter sequence myseq restart with 50
information_schema 表是只读的。
from lealone.
create table if not exists Seller
(
id long auto_increment primary key,
}
我创建表是这样的,然后用Datagrip查询出来的DDL是上面看到的那样子,会自动查询系统自己创建的SEQ
from lealone.
auto_increment 就对应一个私有的 system sequence,设计的目的就是不能让应用插手。
私有 system sequence 的值是会自动根据 primary key 变化的。
如果现有 id 最大是10,然后你自己 insert 新记录时 id 是20,下一个 auto_increment 的 id 就是21了,删除现有记录时私有 system sequence 的值不受影响。
from lealone.
auto_increment 就对应一个私有的 system sequence,设计的目的就是不能让应用插手。 私有 system sequence 的值是会自动根据 primary key 变化的。 如果现有 id 最大是10,然后你自己 insert 新记录时 id 是20,下一个 auto_increment 的 id 就是21了,删除现有记录时私有 system sequence 的值不受影响。
好的谢谢
from lealone.
我刚刚新提交了一个代码,
修改 system sequence 也可以用 ALTER SEQUENCE PUBLIC.SYSTEM_SEQUENCE_9AAF7419_A2BB_4D57_9337_D17693158F81 RESTART WITH 500;
新的值也会立刻生效。
from lealone.
Related Issues (20)
- [chat] QQ 居然也在用 9210 端口 HOT 1
- 能不能出一个单机版mysql迁移到lealone的文档 HOT 6
- 创建mysql数据库报错 HOT 2
- 嵌入式场景多线程并发更新在生产环境导致数据损坏 HOT 67
- pymongo 和nodejs mongodb 报错 HOT 3
- 创建mysql表报错 HOT 1
- lealone问题咨询 HOT 4
- mongodump/mongorestore 报错 HOT 16
- pymongo 不能insert 带“_id”的json, Hexadecimal string with odd number of characters HOT 6
- SPSC队列 HOT 9
- 请问现在是生产环境可用的状态吗? HOT 9
- 数据库运行一段时间出现无法连接的情况 HOT 15
- MySQL客户端执行SQL查询报Lost connection to MySQL server during query HOT 1
- 使用lealone做为postgresql使用,没有默认的数据库 HOT 7
- clob字段更新为null时报错 HOT 1
- packet too large , NPE HOT 4
- mysql function error `SELECT GET_LOCK('cc', 1800)` HOT 1
- 用户交流群 HOT 2
- SQL 错误 [90079] [90079]: Schema "TEST" not found; SQL statement: use test [90079-1] HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lealone.