-- Rick James wrote
>A "temporary table" and the "tmp directory" are unrelated animals.
> A temp table is created in the same place a regular table is created
>tmpdir is used for certain things, like ALTER TABLE.
No, tmpdir isn't used for things like ALTER TABLE.
Quoting: "ALTER TABLE creates a temporary table in the same directory as the original table."
Temporary tables are created in tmpdir, see:
http://dev.mysql.com/doc/refman/5.0/en/temporary-files.html
I ran few quick tests mysql creates temporary files in the tmpdir
Note: tmpdir is /tmp
A) create innodb temporary table:
mysql> create temporary table t (a int, primary key (a)) engine=innodb;
Query OK, 0 rows affected (0.01 sec)
# So I see two files i.e. .frm and .ibd
$ ls -lh /tmp/
total 1.1M
-rw-rw---- 1 mysql mysql 8.4K Jul 17 16:29 #sql1c6f_44_0.frm
-rw-rw---- 1 mysql mysql 96K Jul 17 16:29 #sql1c6f_44_0.ibd