From issues-return-95053-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Wed Apr 10 19:30:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 9F4BF180626 for ; Wed, 10 Apr 2019 21:30:01 +0200 (CEST) Received: (qmail 5006 invoked by uid 500); 10 Apr 2019 19:30:00 -0000 Mailing-List: contact issues-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 issues@ignite.apache.org Received: (qmail 4996 invoked by uid 99); 10 Apr 2019 19:30:00 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Apr 2019 19:30:00 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6719EE0D07 for ; Wed, 10 Apr 2019 19:30:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 21CFC24593 for ; Wed, 10 Apr 2019 19:30:00 +0000 (UTC) Date: Wed, 10 Apr 2019 19:30:00 +0000 (UTC) From: "Pavel Kuznetsov (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-11563) DELETE WHERE does not work in prepared statements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/IGNITE-11563?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 814819#comment-16814819 ]=20 Pavel Kuznetsov commented on IGNITE-11563: ------------------------------------------ So we cannot find the value in the cache except full scan which is slow for= the PK lookup. What I think we can do Let's treat scale of the decimal part of the column type: If user defined c= olumn type as {{DECIMAL(19, 5)}} we should store internally decimal number = with 5 digits after point. as [1]: {quote}For decimal and numeric data types, SQL Server considers each combin= ation of precision and scale as a different data type. For example, decimal= (5,5) and decimal(5,0) are considered different data types.{quote} If user specified value with more scale digits, let's raise error, as H2 do= es. MsSQL uses rounding by default, though. But it rises error if special s= ystem property is set (also see [1]) What to do with the decimal keys, that have been inserted using cache api -= open question. In this case full scans would include some "weird" records.= Could we forbid such puts (with different scale)? Another option - is to a= dd filter condition in the indexes.=20 [1] https://docs.microsoft.com/en-us/sql/t-sql/data-types/decimal-and-numer= ic-transact-sql?view=3Dsql-server-2017=20 > DELETE WHERE does not work in prepared statements > ------------------------------------------------- > > Key: IGNITE-11563 > URL: https://issues.apache.org/jira/browse/IGNITE-11563 > Project: Ignite > Issue Type: Bug > Components: sql > Affects Versions: 2.7 > Reporter: Stefan > Assignee: Pavel Kuznetsov > Priority: Minor > Time Spent: 10m > Remaining Estimate: 0h > > With SQL I cannot delete a row using a prepared statement. The following = statement is simply ignored: > {{DELETE}} {{FROM}} {{AnyTable WHERE}} {{id =3D ?}} > This happens with JDBC-Thin and with ODBC so I suspect that the cluster = gets the correct data but handles it wrong. By adding an always-true-condit= ion it works as expected: > {{DELETE}} {{FROM}} {{AnyTable WHERE}} {{id =3D id AND}} {{id =3D ?}} > I tested with a very simple table that was created with: > {{CREATE TABLE testtable (}} > {{=C2=A0=C2=A0=C2=A0 "ID" NUMBER(19,0),}} > {{=C2=A0=C2=A0=C2=A0 "VALUE" VARCHAR2(255 CHAR),}} > {{=C2=A0=C2=A0=C2=A0 PRIMARY KEY (ID)}} > {{) WITH "template=3Dreplicated,cache_name=3Dtesttable"}} -- This message was sent by Atlassian JIRA (v7.6.3#76005)