Unsupported Screen Size: The viewport size is too small for the theme to render properly.

Temporary Tables

forums forums SQLyog Using SQLyog Temporary Tables

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #11534
      tobiha
      Member

      Hello

      When I've created a temp table, isn't there anywhere to see it in SQLyog?

    • #29127
      peterlaursen
      Participant

      no …

      Actually there is no way to query the server about it. SHOW (FULL) TABLES, SELECT FROM INFORMATION_SCHEMA.TABLES etc. do not expose it. Temporary tables exist on a 'session-basis'. Actually you can have a (normal) table and a temporary table named the same what creates a very weird situation. Try this

      USE `test`;

      DROP TABLE IF EXISTS `t1`;

      CREATE TABLE `t1` (

      `id` SMALLINT(6) UNSIGNED NOT NULL AUTO_INCREMENT,

      `txt` VARCHAR(50) DEFAULT NULL,

      PRIMARY KEY (`id`)

      ) ENGINE=INNODB DEFAULT CHARSET=utf8;

      INSERT INTO `t1` VALUES (1,'a');

      CREATE TEMPORARY TABLE `t1` (

      `id` SMALLINT(6) UNSIGNED NOT NULL AUTO_INCREMENT,

      `txt` VARCHAR(50) DEFAULT NULL,

      PRIMARY KEY (`id`)

      ) ENGINE=MYISAM DEFAULT CHARSET=utf8;

      INSERT INTO `t1` VALUES (7,'x');

      SELECT * FROM `t1`;

      SHOW FULL TABLES;

      SHOW TABLE STATUS FROM `test`;

      DROP TABLE `t1`;

      SELECT * FROM `t1`;

      I reported this to MySQL as a bug 2-3 years ago. They classified it as a 'feature request'.

      What we could do however was to record *client-side* what temporary tables are in existence for the session. But we don't. And I do not think any client does.

    • #29128
      tobiha
      Member

      Thanks for a great answer.

      'feature request' 😆

Viewing 2 reply threads
  • You must be logged in to reply to this topic.