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 6AE1B200BD0 for ; Wed, 30 Nov 2016 14:27:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 67166160B08; Wed, 30 Nov 2016 13:27:22 +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 8A59D160B19 for ; Wed, 30 Nov 2016 14:27:21 +0100 (CET) Received: (qmail 61964 invoked by uid 500); 30 Nov 2016 13:27:04 -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 61786 invoked by uid 99); 30 Nov 2016 13:27:04 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Nov 2016 13:27:04 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B79B22C03DB for ; Wed, 30 Nov 2016 13:26:58 +0000 (UTC) Date: Wed, 30 Nov 2016 13:26:58 +0000 (UTC) From: "Alexander Paschenko (JIRA)" To: dev@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (IGNITE-4340) Implicitly cast new column values to expected types on SQL UPDATE MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 30 Nov 2016 13:27:22 -0000 Alexander Paschenko created IGNITE-4340: ------------------------------------------- Summary: Implicitly cast new column values to expected types on SQL UPDATE Key: IGNITE-4340 URL: https://issues.apache.org/jira/browse/IGNITE-4340 Project: Ignite Issue Type: Improvement Components: SQL Affects Versions: 1.8 Reporter: Alexander Paschenko Assignee: Alexander Paschenko Fix For: 1.8 When the following query is run, {code:sql} update AllTypes set longCol = 1 where _key = ? {code} it fails with exception {noformat} Suppressed: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing$RowDescriptor.wrap(IgniteH2Indexing.java:2960) at org.apache.ignite.internal.processors.query.h2.opt.GridH2AbstractKeyValueRow.getValue(GridH2AbstractKeyValueRow.java:316) at org.h2.index.BaseIndex.compareRows(BaseIndex.java:294) at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex$2.compare(GridH2TreeIndex.java:103) at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex$2.compare(GridH2TreeIndex.java:95) at java.util.concurrent.ConcurrentSkipListMap$ComparableUsingComparator.compareTo(ConcurrentSkipListMap.java:647) at java.util.concurrent.ConcurrentSkipListMap.findPredecessor(ConcurrentSkipListMap.java:727) at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:850) at java.util.concurrent.ConcurrentSkipListMap.put(ConcurrentSkipListMap.java:1645) at org.apache.ignite.internal.processors.query.h2.opt.GridH2TreeIndex.put(GridH2TreeIndex.java:362) at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.doUpdate(GridH2Table.java:566) at org.apache.ignite.internal.processors.query.h2.opt.GridH2Table.update(GridH2Table.java:495) at org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing.store(IgniteH2Indexing.java:603) at org.apache.ignite.internal.processors.query.GridQueryProcessor.store(GridQueryProcessor.java:737) at org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager.store(GridCacheQueryManager.java:431) at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.updateIndex(GridCacheMapEntry.java:4019) at org.apache.ignite.internal.processors.cache.GridCacheMapEntry.innerUpdate(GridCacheMapEntry.java:2458) at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateSingle(GridDhtAtomicCache.java:2385) at org.apache.ignite.internal.processors.cache.distributed.dht.atomic.GridDhtAtomicCache.updateAllAsyncInternal0(GridDhtAtomicCache.java:1787) {noformat} It's due to that UPDATE's SELECT part selects 1 as int, and that's what we're setting to field. Problem can be solved by casting SELECTed values to the types that columns expect. -- This message was sent by Atlassian JIRA (v6.3.4#6332)