Skip to content

Instantly share code, notes, and snippets.

@jsmecham
Last active August 29, 2015 14:08
Show Gist options
  • Save jsmecham/c82cc6150be84947d1f0 to your computer and use it in GitHub Desktop.
Save jsmecham/c82cc6150be84947d1f0 to your computer and use it in GitHub Desktop.
MySQL Craziness
~ % mysql test
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 279
Server version: 5.6.21 Homebrew
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> CREATE TEMPORARY TABLE foo (id int(11) auto_increment primary key, bars int(11));
Query OK, 0 rows affected (0.01 sec)
mysql> CREATE TABLE foo (id int(11) auto_increment primary key, baz int(11));
Query OK, 0 rows affected (0.02 sec)
mysql> SHOW CREATE TABLE foo;
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| foo | CREATE TEMPORARY TABLE `foo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`bars` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment