← Back to team overview

drizzle-discuss team mailing list archive

Re: CREATE TABLE LIKE

 

Brian Aker wrote:
Hi!

In this case:

CREATE TEMPORARY TABLE t1 (
  id INT NOT NULL
, padding VARCHAR(200) NOT NULL
);

CREATE TABLE t2 LIKE t1;

Should t2 be a TEMPORARY table or not? What if the engine for t1 can't be TEMPORARY? Toss an error?

It seems like to me that either we should toss and error, or t2 should be identical to t1.

My vote is toss an error:

a) When t1's engine is temporary and t2's engine is not specified.
b) When t1's engine is temporary and t2's specified engine cannot handle regular tables.

I prefer explicit over implicit and therefore vote against letting the t2 table's storage engine default to the default storage engine. We're talking about DDL operations here, not every-day stuff that would be a pain in the butt to type out the ENGINE=XXX clause.

Explicit++

-jay



Follow ups

References