Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3794

temporary table don't execute like normal table

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.25-galera
    • None
    • None
    • None
    • linux

    Description

      hi guys i'm trying to execute this query:

      CREATE TABLE `ROTAS_21a17623d58902237b1cea833b4c4e14` (
      `plano_conta_id` bigint(20) NOT NULL DEFAULT '0',
      `plano_conta_id_red` bigint(20) NOT NULL DEFAULT '0',
      `plano_conta_numero` varchar(255) NOT NULL DEFAULT '',
      `descricao` varchar(255) NOT NULL DEFAULT '',
      `habilitado` enum('Y','N') NOT NULL DEFAULT 'Y',
      `tipo` enum('','-') NOT NULL DEFAULT '',
      `comp_automatico_tipo` enum('bc','pess','bc-pre','pess-pre','est','est-pre','') NOT NULL DEFAULT '',
      `comp_automatico` varchar(255) NOT NULL DEFAULT '',
      `contabil_tipo_conta` varchar(255) NOT NULL,
      `contabil_tipo_saldo` enum('d','c','','0') NOT NULL,
      `contabil_tipo_lancamentos` enum('d','c','dc') NOT NULL,
      PRIMARY KEY (`plano_conta_id`,`plano_conta_numero`),
      UNIQUE KEY `NewIndex` (`plano_conta_id`,`plano_conta_id_red`)
      )
      ;
      SELECT a.pessoa_tipo,a.pessoa_id,a.spavendas_vendedor_tipo,a.spavendas_vendedor_id,a.spavendas_tbl_preco,a.cfop_vendas_id,a.cfop_vendas_id_red,a.spacompra_vendedor_tipo,a.spacompra_vendedor_id,a.cfop_compra_id,a.cfop_compra_id_red,(SELECT plano_conta_numero FROM ROTAS_21a17623d58902237b1cea833b4c4e14 WHERE plano_conta_id=a.rota_distribuicao_id AND plano_conta_id_red=a.rota_distribuicao_id_red) AS rota_numero,(SELECT descricao FROM ROTAS_21a17623d58902237b1cea833b4c4e14 WHERE plano_conta_id=a.rota_distribuicao_id AND plano_conta_id_red=a.rota_distribuicao_id_red) AS rota_desc,a.rota_distribuicao_sequencia,'j' AS distribuidor_tipo,id AS distribuidor_id,IF(a.pessoa_tipo='f',(SELECT (pais_entrega || uf_entrega || municipio_entrega || bairro_entrega || endereco_entrega_rua || endereco_entrega_numero || endereco_entrega_complemento) AS tmp_end FROM pessoa_fisica WHERE id=a.pessoa_id),(SELECT (pais_entrega || uf_entrega || municipio_entrega || bairro_entrega || endereco_entrega_rua || endereco_entrega_numero || endereco_entrega_complemento) AS tmp_end FROM pessoa_juridica WHERE id=a.pessoa_id)) AS end_2,IF(a.pessoa_tipo='f',(SELECT IF(habilitada!='a','Y','N') FROM pessoa_fisica WHERE id=a.pessoa_id),(SELECT IF(habilitada!='a','Y','N') FROM pessoa_juridica WHERE id=a.pessoa_id)) AS desabilitado,IF(a.pessoa_tipo='f',(SELECT vendas_bloqueada FROM pessoa_fisica WHERE id=a.pessoa_id),(SELECT vendas_bloqueada FROM pessoa_juridica WHERE id=a.pessoa_id)) AS vendas_bloqueada,(SELECT plano_conta_numero FROM ROTAS_21a17623d58902237b1cea833b4c4e14 WHERE plano_conta_id=a.rota_comercial_id AND plano_conta_id_red=a.rota_comercial_id_red) AS rota_comercial_numero,(SELECT descricao FROM ROTAS_21a17623d58902237b1cea833b4c4e14 WHERE plano_conta_id=a.rota_comercial_id AND plano_conta_id_red=a.rota_comercial_id_red) AS rota_comercial_descricao,a.rota_comercial_sequencia,a.data_ultima_venda FROM pessoa_juridica_mov AS a WHERE id=1 AND spavendas_vendedor_id=0 ORDER BY desabilitado,vendas_bloqueada,data_ultima_venda,spavendas_vendedor_tipo,IF(spavendas_vendedor_id=0,100000000,spavendas_vendedor_id),rota_numero,rota_distribuicao_sequencia,pessoa_tipo,pessoa_id

      it runs fine it table isn't temporary
      when it's temporary the error is :
      /* SQL Error (1137): Não pode reabrir a tabela 'ROTAS_21a17623d58902237b1cea833b4c4e14 */

      any idea?

      Attachments

        Activity

          People

            Unassigned Unassigned
            rspadim roberto spadim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.