Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2AD76200BD7 for ; Wed, 2 Nov 2016 10:47:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 2977F160AEA; Wed, 2 Nov 2016 09:47:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8EC18160B0B for ; Wed, 2 Nov 2016 10:46:59 +0100 (CET) Received: (qmail 57683 invoked by uid 500); 2 Nov 2016 09:46:58 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 57503 invoked by uid 99); 2 Nov 2016 09:46:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Nov 2016 09:46:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 76CFC2C2A6B for ; Wed, 2 Nov 2016 09:46:58 +0000 (UTC) Date: Wed, 2 Nov 2016 09:46:58 +0000 (UTC) From: "Anghel Botos (JIRA)" To: dev@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IGNITE-4163) Wrong SQL generated by org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect#loadCacheSelectRangeQuery MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 02 Nov 2016 09:47:00 -0000 Anghel Botos created IGNITE-4163: ------------------------------------ Summary: Wrong SQL generated by org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect#loadCacheSelectRangeQuery Key: IGNITE-4163 URL: https://issues.apache.org/jira/browse/IGNITE-4163 Project: Ignite Issue Type: Bug Components: SQL Affects Versions: 1.7 Reporter: Anghel Botos The SQL statement generated by org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect#loadCacheSelectRangeQuery looks like this: {{SELECT KEY_COLUMN_1,KEY_COLUMN_2 FROM (SELECT KEY_COLUMN_1,KEY_COLUMN_2, ROWNUM() AS rn FROM SOME_TABLE ORDER BY KEY_COLUMN_1,KEY_COLUMN_2) WHERE mod(rn, ?) = 0}} For Oracle this is incorrect, as Oracle does not have a {{ROWNUM()}} function. For the above query the following error is thrown: {{ORA-00923: FROM keyword not found where expected}} Regarding row numbering Oracle has: * a {{ROWNUM}} pseudocolumn, in which case the query should have {{ROWNUM AS rn}} * a {{ROW_NUMBER()}} function, in which case the query would become more complicated. See https://docs.oracle.com/database/121/SQLRF/functions170.htm#SQLRF06100 for more details about {{ROW_NUMBER()}} Please make the neccessary adjustments to either {{BasicJdbcDialect}} or {{OracleDialect}} so that a correct query is produced. -- This message was sent by Atlassian JIRA (v6.3.4#6332)