[MCOL-876] Renaming a table in non-current database fails Created: 2017-08-15 Updated: 2018-04-05 Resolved: 2018-02-13 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | DDLProc |
| Affects Version/s: | 1.0.10 |
| Fix Version/s: | 1.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Matthew Minix | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Centos 7 |
||
| Issue Links: |
|
||||||||||||||||
| Epic Link: | ColumnStore Compatibility Improvements | ||||||||||||||||
| Sprint: | 2018-03, 2018-04 | ||||||||||||||||
| Description |
|
When trying to rename a table in a database that is not active (via USE), rename attempts to use the current database instead. eg: CREATE TABLE IF NOT EXISTS data.blah ( USE test; RENAME TABLE data.blah TO data.blah2; generates the error Internal error: CAL0001: Alter table Failed: IDB-2006: 'test.blah' does not exist in Columnstore. Effectively ignoring the database name (data in this care) in the Rename table statement. |
| Comments |
| Comment by David Thompson (Inactive) [ 2017-11-27 ] |
|
confirmed this still is an issue in 1.1.2 |
| Comment by Roman [ 2018-02-01 ] |
|
The RENAME command isn't supported by Columnstore nevertheless there is another DDL command that could be used as a workaround, namely ALTER TABLE test.cs RENAME TO test.test. With this commit that has been already merged I could rename table resides in another schema. |
| Comment by Roman [ 2018-02-07 ] |
|
Added support for the feature and made this PR. |
| Comment by Roman [ 2018-02-07 ] |
|
Please take a look at the change. There is one thing mentioned to note. The syntax doesn't support multiply tables rename in one statement since I reused the existing code. But I decided that the whole new infstrastructure: ddl parser tokens and class, grammar changes and ddlproc class - would be an overkill for the feature. |
| Comment by Andrew Hutchings (Inactive) [ 2018-02-07 ] |
|
Fix looks good and is merged. I'll open a subsequent feature request ticket for multi table rename (not to be implemented for now). For QA: See tests in pull request for more information. |
| Comment by Daniel Lee (Inactive) [ 2018-02-13 ] |
|
Build verified: Github source 1.2.0-1 /root/columnstore/mariadb-columnstore-server Update README.md diff --git a/README.md b/README.md ```bash
/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine Merge pull request #399 from drrtuy/ |