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 633B5200C24 for ; Thu, 9 Feb 2017 02:33:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 620D0160B67; Thu, 9 Feb 2017 01:33:50 +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 ABF8D160B49 for ; Thu, 9 Feb 2017 02:33:49 +0100 (CET) Received: (qmail 59049 invoked by uid 500); 9 Feb 2017 01:33:49 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 59040 invoked by uid 99); 9 Feb 2017 01:33:48 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2017 01:33:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 63255180684 for ; Thu, 9 Feb 2017 01:33:48 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id o8Mx3JKhC84e for ; Thu, 9 Feb 2017 01:33:47 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id C71E55F613 for ; Thu, 9 Feb 2017 01:33:46 +0000 (UTC) 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 B4279E04B5 for ; Thu, 9 Feb 2017 01:33:42 +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 AEA422528D for ; Thu, 9 Feb 2017 01:33:41 +0000 (UTC) Date: Thu, 9 Feb 2017 01:33:41 +0000 (UTC) From: "Andrus Adamchik (JIRA)" To: commits@cayenne.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAY-2222) MySQLAdapter should not create indexes on FK columns MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 09 Feb 2017 01:33:50 -0000 [ https://issues.apache.org/jira/browse/CAY-2222?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrus Adamchik updated CAY-2222: --------------------------------- Description: MySQLAdapter has this comment in the "createTableAppendPKClause" method: // if FK constraints are supported, we must add indices to all FKs // Note that according to MySQL docs, FK indexes are created // automatically when constraint is defined, starting at MySQL 4.1.2 And then it proceeds to add indexes for all FKs. This becomes a problem when a user wants to generate MySQL schema without FK constraints. In which case those columns still end up having an index. While we can refactor this in a backwards compatible manner, I think we can just drop support for explicit index creation, streamlining the code. After all MySQL 4.1.2 was released in 2004. If someone still needs support for older MySQL, I guess a whole new adapter should be created. was: MySQLAdapter has this comment in the "createTableAppendPKClause" method: // if FK constraints are supported, we must add indices to all FKs // Note that according to MySQL docs, FK indexes are created // automatically when constraint is defined, starting at MySQL 4.1.2 and then it proceeds to add indexe for all FKs. This becomes a problem when a user wants to generate MySQL schema without FK constraints. In which case those columns still end up having an index. While we can refactor this in a backwards compatible manner, I think we can just drop support for explicit index creation. After all MySQL 4.1.2 was released in 2004. > MySQLAdapter should not create indexes on FK columns > ---------------------------------------------------- > > Key: CAY-2222 > URL: https://issues.apache.org/jira/browse/CAY-2222 > Project: Cayenne > Issue Type: Bug > Reporter: Andrus Adamchik > Assignee: Andrus Adamchik > Priority: Minor > Fix For: 4.0.M5 > > > MySQLAdapter has this comment in the "createTableAppendPKClause" method: > // if FK constraints are supported, we must add indices to all FKs > // Note that according to MySQL docs, FK indexes are created > // automatically when constraint is defined, starting at MySQL 4.1.2 > And then it proceeds to add indexes for all FKs. This becomes a problem when a user wants to generate MySQL schema without FK constraints. In which case those columns still end up having an index. While we can refactor this in a backwards compatible manner, I think we can just drop support for explicit index creation, streamlining the code. After all MySQL 4.1.2 was released in 2004. > If someone still needs support for older MySQL, I guess a whole new adapter should be created. -- This message was sent by Atlassian JIRA (v6.3.15#6346)