CREATE OR REPLACE TABLE (MDEV-5491)

[MDEV-5519] CREATE OR REPLACE TABLE .. LIKE is allowed, but does not work as expected Created: 2014-01-11  Updated: 2014-01-14  Resolved: 2014-01-14

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: 10.0.8

Type: Technical task Priority: Minor
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates

 Description   

Syntax CREATE OR REPLACE TABLE foo LIKE bar is accepted, but it does actually not replace the table. If table `foo` already exists, it causes ER_TABLE_EXISTS_ERROR:

MariaDB [test]> drop table if exists t1, t2;
Query OK, 0 rows affected (0.35 sec)
 
MariaDB [test]> create table t1 (i int);
Query OK, 0 rows affected (1.61 sec)
 
MariaDB [test]> create table t2 like t1;
Query OK, 0 rows affected (1.67 sec)
 
MariaDB [test]> create or replace table t2 like t1;
ERROR 1050 (42S01): Table 't2' already exists

revision-id: monty@askmonty.org-20140110153917-3r8owmbgslg2552n
revno: 3965
branch-nick: mariadb-monty



 Comments   
Comment by Michael Widenius [ 2014-01-14 ]

Fixed

Generated at Thu Feb 08 07:05:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.