I agree with Eric on this. My gut reaction is that LIKE in this context exists to suck in the column names, types, etc. but not to exactly duplicate the table under a different name.
Judging from the responses so far, I would not expect much in the way of consensus. I think there are too many reasonable interpretations of what could be considered "correct" in this case. Jeremy On Tue, Nov 17, 2009 at 1:15 PM, Eric Day <[email protected]> wrote: > 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<https://launchpad.net/%7Edrizzle-discuss> > > Post to : [email protected] > > Unsubscribe : > > https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss> > > More help : https://help.launchpad.net/ListHelp > > _______________________________________________ > Mailing list: > https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss> > Post to : [email protected] > Unsubscribe : > https://launchpad.net/~drizzle-discuss<https://launchpad.net/%7Edrizzle-discuss> > More help : https://help.launchpad.net/ListHelp >
_______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

