Comments (6)
We can probably easily make the syntax a no-op. Would that work for you?
from go-mysql-server.
Yes! That would be good!
These statements run as part of our migrations so it's needed for us.
I think there was another example of a MySQL partition query failing. I'll update the issue tomorrow
from go-mysql-server.
ok the other statement that we have issues with is when you specify the algorithm when a table is modified. In the example i shared would be sql2
and this kind of statement:
ALTER TABLE Test MODIFY b_key VARCHAR(20) NOT NULL, ALGORITHM=INPLACE, LOCK=NONE;
from go-mysql-server.
Hey @xocasdashdash thanks for reporting this issue.
This PR, dolthub/vitess#340, should properly parse the create table ...
query you mentioned.
It's currently in review, and should be merged soon.
Heads up, the create table ...
query parses in MySQL, but throws
ERROR: 1492: For RANGE partitions each partition must be defined
It'll still be a no-op in dolt/gms right now, but may eventually change to match MySQL.
I'm currently looking into adding parser support for the alter table ...
query.
from go-mysql-server.
Hey @xocasdashdash thanks for reporting this issue.
This PR, dolthub/vitess#340, should properly parse the
create table ...
query you mentioned. It's currently in review, and should be merged soon.Heads up, the
create table ...
query parses in MySQL, but throwsERROR: 1492: For RANGE partitions each partition must be defined
It'll still be a no-op in dolt/gms right now, but may eventually change to match MySQL.
I'm currently looking into adding parser support for the
alter table ...
query.
Ahh thanks so much, yeah we actually have the full range defined.
Here's an example:
CREATE TABLE `t` (
`t_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` datetime,
PRIMARY KEY (`t_key`, `created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
PARTITION BY RANGE (MONTH(`created_at`)) (
PARTITION p1 VALUES LESS THAN (2),
PARTITION p2 VALUES LESS THAN (3),
PARTITION p3 VALUES LESS THAN (4),
PARTITION p4 VALUES LESS THAN (5),
PARTITION p5 VALUES LESS THAN (6),
PARTITION p6 VALUES LESS THAN (7),
PARTITION p7 VALUES LESS THAN (8),
PARTITION p8 VALUES LESS THAN (9),
PARTITION p9 VALUES LESS THAN (10),
PARTITION p10 VALUES LESS THAN (11),
PARTITION p11 VALUES LESS THAN (12),
PARTITION p12 VALUES LESS THAN (13)
);
```
Is this going to be supported too?
from go-mysql-server.
Yep, that query is already supported in dolt/gms right now!
It is a no-op though
tmp/main*> CREATE TABLE `t` (
-> `t_key` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
-> `created_at` datetime,
-> PRIMARY KEY (`t_key`, `created_at`)
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
-> PARTITION BY RANGE (MONTH(`created_at`)) (
-> PARTITION p1 VALUES LESS THAN (2),
-> PARTITION p2 VALUES LESS THAN (3),
-> PARTITION p3 VALUES LESS THAN (4),
-> PARTITION p4 VALUES LESS THAN (5),
-> PARTITION p5 VALUES LESS THAN (6),
-> PARTITION p6 VALUES LESS THAN (7),
-> PARTITION p7 VALUES LESS THAN (8),
-> PARTITION p8 VALUES LESS THAN (9),
-> PARTITION p9 VALUES LESS THAN (10),
-> PARTITION p10 VALUES LESS THAN (11),
-> PARTITION p11 VALUES LESS THAN (12),
-> PARTITION p12 VALUES LESS THAN (13)
-> );
tmp/main*> show create table t;
+-------+--------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------+
| t | CREATE TABLE `t` ( |
| | `t_key` varchar(100) NOT NULL, |
| | `created_at` datetime NOT NULL, |
| | PRIMARY KEY (`t_key`,`created_at`) |
| | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |
+-------+--------------------------------------------------------------------+
1 row in set (0.00 sec)
I'm still working on getting the ALTER TABLE...
statement parsing.
from go-mysql-server.
Related Issues (20)
- go mod tidy error HOT 2
- add create table comment on table clause to table spec HOT 1
- Can't turn on multiStatements when using memory driver HOT 2
- Does it support `Functional Key Parts` index ? HOT 2
- Server error message compatibility when doing INSERT HOT 3
- Foreign key constraints break auto-incrementing ids in memory mode HOT 3
- Panic when executing sql statements from external command line tool after startup HOT 7
- Self-referencing foreign key constraint breaks auto-incrementing ids in memory mode HOT 2
- Potential regression: number cast to JSON no longer read as float HOT 2
- Running multiple migrations in a transaction HOT 2
- Primary key column order changes column order on insert HOT 1
- Consistent usage of variables in the example
- MemoryDB: Deleting rows silently fails if there are multiple CASCADING constraints pointing to the same parent HOT 1
- MemoryDB: UPDATE succeeds but is not reflected in subsequent SELECT
- Feature request: persistent database store HOT 1
- Any Benchmarks available HOT 1
- Problems with MySQL Connector/NET (Mysql.Data) and go-mysql-server HOT 2
- "ON UPDATE CURRENT_TIMESTAMP" not come into effect
- Update flatbuffers to fix go-mysql-server builds in Bazel environments
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 go-mysql-server.