Skip Menu |
 

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 78869
Status: new
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: fred.lindberg [...] yudoglobal.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From fred.lindberg [...] yudoglobal.com Thu Aug 9 11: 46:14 2012
MIME-Version: 1.0
X-Spam-Status: No, score=-6.176 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Spam-Flag: NO
X-Provags-ID: V02:K0:hcC01lqD+/KnlWWTW+EF36IFenEUOgF7UnHRgEPHit7 2XsF5r07vtY4Sut0idrT1X+Hpo5bHOrVhYro2J2lcbULagH/g2 sjN2R83opQGvSbFG0A0Y8wuQnf4Ak9ZwNagZ2EGaqEBSK+9qDx q8XzPaOnnIF8W6IeJZa57VerPNK45wKCeJdb4c+f/mGx4zmHJn eKfWzwGWJElLuZOMqB3Z8lySRa36Dg4RAeSuj2nzm0uIAvCrEe OJA5wM/DsFiM/uSk4hK2/qlX/mpEzx9NfmnYCkfcAp9cjkmVjt nEVsV1kPowLkkBWz+C3N5DGpVp/vqU+u9ZmF6pLAtipEgwGohv OQ6Rogn35GxwCTggF0LEUpm0IDBxh3vhK5XKJmoGLtSpqDFS1x lN+We1etq/d6x8EuN02PQwCilwQ26rZVsg=
Content-Type: text/html; charset=utf-8
Message-ID: <6856.4.db1cbe [...] ydm1.yudoglobal.com>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.176
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 7CF0424064E for <cpan-bug+sql-translator [...] hipster.bestpractical.com>; Thu, 9 Aug 2012 11:46:14 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VbVdN71yTYaY for <cpan-bug+sql-translator [...] hipster.bestpractical.com>; Thu, 9 Aug 2012 11:46:12 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 697262405BF for <bug-sql-translator [...] rt.cpan.org>; Thu, 9 Aug 2012 11:46:12 -0400 (EDT)
Received: (qmail 28447 invoked by uid 103); 9 Aug 2012 15:46:11 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 9 Aug 2012 15:46:11 -0000
Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.17.8) by 16.mx.develooper.com (qpsmtpd/0.80/v0.80-19-gf52d165) with ESMTP; Thu, 09 Aug 2012 08:46:09 -0700
Received: from domU-12-31-38-00-B6-54.compute-1.internal (ec2-23-21-133-102.compute-1.amazonaws.com [23.21.133.102]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0Ln0qf-1TfxcO0uyr-00hJDH; Thu, 09 Aug 2012 17:46:05 +0200
Delivered-To: cpan-bug+sql-translator [...] hipster.bestpractical.com
Subject: view creation from select fails where select lacks table
Return-Path: <fred.lindberg [...] yudoglobal.com>
X-RT-Mail-Extension: sql-translator
X-Original-To: cpan-bug+sql-translator [...] hipster.bestpractical.com
X-Spam-Check-BY: 16.mx.develooper.com
Date: Thu, 9 Aug 2012 15:45:52 +0000 (UTC)
X-Spam-Level:
To: "bug-SQL-Translator [...] rt.cpan.org" <bug-sql-translator [...] rt.cpan.org>
Content-Transfer-Encoding: quoted-printable
From: Fred Lindberg <fred.lindberg [...] yudoglobal.com>
X-RT-Original-Encoding: utf-8
Content-Length: 2961
SQL-Translator-0.11012
Parser::MySQL.pm
3.2.0-27-generic-pae #43-Ubuntu
This is perl 5, version 14, subversion 2 (v5.14.2)

Hi, I am using your very helpful module to parse MySQL-workbench output DDL and trying to convert to Oracle DDL. The third statement below fails to parse.

CREATE TABLE IF NOT EXISTS `CurrentEpoch` (`currentEpoch` INT);
DROP TABLE IF EXISTS `CurrentEpoch`;
CREATE  OR REPLACE VIEW `CurrentEpoch` AS^M
select unix_timestamp() as currentEpoch
;

it looks like the grammar does not allow the select without a table:

view_select_statement : /[(]?/ /select/i view_column_def /from/i view_table_def /[)]?/

If I modify the SQL statement to include a dummy table, it parses:

CREATE  OR REPLACE VIEW `CurrentEpoch` AS^M
select unix_timestamp() from Dual as currentEpoch
;

The table is optional in MySQL select statements:
http://dev.mysql.com/doc/refman/5.1/en/select.html

SELECT
    [ALL | DISTINCT | DISTINCTROW ]
      [HIGH_PRIORITY]
      [STRAIGHT_JOIN]
      [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
      [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
    select_expr [, select_expr ...]
    [FROM table_references
    [WHERE where_condition]
    [GROUP BY {col_name | expr | position}
      [ASC | DESC], ... [WITH ROLLUP]]
    [HAVING where_condition]
    [ORDER BY {col_name | expr | position}
      [ASC | DESC], ...]
    [LIMIT {[offset,] row_count | row_count OFFSET offset}]
    [PROCEDURE procedure_name(argument_list)]
    [INTO OUTFILE 'file_name'
        [CHARACTER SET charset_name]
        export_options
      | INTO DUMPFILE 'file_name'
      | INTO var_name [, var_name]]
    [FOR UPDATE | LOCK IN SHARE MODE]]

Thanks!

Fred Lindberg



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.