← Back to team overview

drizzle-discuss team mailing list archive

Re: CREATE TABLE LIKE

 

Hi!

Is this defined in the standard anywhere as far as what should be
carried over? Or is LIKE a MySQL-ism? If there is no standard, my vote
would be for LIKE to only carry over the column attributes. If you want
t2 to also be TEMPORARY, specify:  CREATE TEMPORARY TABLE t2 LIKE t1;

I think storage engine should use the default if none is given too,
not the SE of t1.

-Eric

On Tue, Nov 17, 2009 at 01:01:14PM -0800, 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.
> 
> Thoughts? Opinions?
> 
> Cheers,
> 	-Brian
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to     : drizzle-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help   : https://help.launchpad.net/ListHelp



Follow ups

References