[
https://issues.apache.org/jira/browse/FINERACT-1451?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Thomas Kerin updated FINERACT-1451:
-----------------------------------
Description:
The 'name' index on the m_selfservice_beneficiaries_tpt table prevents a client
from adding two
{{Server error:}}
{{{}Duplicate entry 'Clint Westwood-4-\x01' for key 'name' {prepstmnt 128161655
INSERT INTO m_selfservice_beneficiaries_tpt (account_id, account_type,
ap{}}}{{{}p_user_id, client_id, is_active, name, office_id, transfer_limit)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)} [code=1062, state=23000]{}}}
{{mysql> show index from m_selfservice_beneficiaries_tpt;}}
{{{+}--------------------------------{-}{-}{+}----------{-}++{-}--------{-}{-}------------{-}++{-}-----------{-}{-}---------{-}++{-}-----------{-}{-}--------{-}++{-}------{-}{-}----{-}++{-}----------{-}{-}-------{-}++{-}--------------}}
{{| Table | Non_unique | Key_name | Seq_in_index |
Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type |
Comment | Index_comment |}}
{{{+}--------------------------------{-}{-}{+}----------{-}++{-}--------{-}{-}------------{-}++{-}-----------{-}{-}---------{-}++{-}-----------{-}{-}--------{-}++{-}------{-}{-}----{-}++{-}----------{-}{-}-------{-}++{-}--------------}}
{{| m_selfservice_beneficiaries_tpt | 0 | PRIMARY | 1 | id
| A | 1 | NULL | NULL | | BTREE |
| |}}
{{| m_selfservice_beneficiaries_tpt | 0 | name | 1 |
name | A | 1 | NULL | NULL | | BTREE |
| |}}
{{| m_selfservice_beneficiaries_tpt | 0 | name | 2 |
app_user_id | A | 1 | NULL | NULL | | BTREE |
| |}}
{{| m_selfservice_beneficiaries_tpt | 0 | name | 3 |
is_active | A | 1 | NULL | NULL | | BTREE |
| |}}
{{{+}--------------------------------{-}{-}{+}----------{-}++{-}--------{-}{-}------------{-}++{-}-----------{-}{-}---------{-}++{-}-----------{-}{-}--------{-}++{-}------{-}{-}----{-}++{-}----------{-}{-}-------{-}++{-}--------------}}
was:
{{{}See this error in logs:{}}}{{{}Duplicate entry 'Clint Westwood-4-\x01' for
key 'name' {prepstmnt 128161655 INSERT INTO m_selfservice_beneficiaries_tpt
(account_id, account_type, ap{}}}
{{p_user_id, client_id, is_active, name, office_id, transfer_limit) VALUES (?,
?, ?, ?, ?, ?, ?, ?)} [code=1062, state=23000]}}
{{{}Indexes{}}}{{{}mysql> show index from m_selfservice_beneficiaries_tpt;{}}}
{{+---------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+}}
{{| Table | Non_unique | Key_name | Seq_in_index |
Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type |
Comment | Index_comment |}}
{{+---------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+}}
{{| m_selfservice_beneficiaries_tpt | 0 | PRIMARY | 1 | id
| A | 1 | NULL | NULL | | BTREE |
| |}}
{{| m_selfservice_beneficiaries_tpt | 0 | name | 1 |
name | A | 1 | NULL | NULL | | BTREE |
| |}}
{{| m_selfservice_beneficiaries_tpt | 0 | name | 2 |
app_user_id | A | 1 | NULL | NULL | | BTREE |
| |}}
{{| m_selfservice_beneficiaries_tpt | 0 | name | 3 |
is_active | A | 1 | NULL | NULL | | BTREE |
| |}}
{{{}+---------------------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+{}}}{{{}Seems
to be the 'name' index triggering - name+app_user_id+is_active looks like the
offending entry above{}}}
> Beneficiary: unable to add a second beneficiary (same name as first, but
> different accountNo/currency)
> ------------------------------------------------------------------------------------------------------
>
> Key: FINERACT-1451
> URL: https://issues.apache.org/jira/browse/FINERACT-1451
> Project: Apache Fineract
> Issue Type: Bug
> Components: Database
> Affects Versions: 1.5.0
> Reporter: Thomas Kerin
> Priority: Major
>
> The 'name' index on the m_selfservice_beneficiaries_tpt table prevents a
> client from adding two
>
> {{Server error:}}
> {{{}Duplicate entry 'Clint Westwood-4-\x01' for key 'name' {prepstmnt
> 128161655 INSERT INTO m_selfservice_beneficiaries_tpt (account_id,
> account_type, ap{}}}{{{}p_user_id, client_id, is_active, name, office_id,
> transfer_limit) VALUES (?, ?, ?, ?, ?, ?, ?, ?)} [code=1062, state=23000]{}}}
>
> {{mysql> show index from m_selfservice_beneficiaries_tpt;}}
> {{{+}--------------------------------{-}{-}{+}----------{-}++{-}--------{-}{-}------------{-}++{-}-----------{-}{-}---------{-}++{-}-----------{-}{-}--------{-}++{-}------{-}{-}----{-}++{-}----------{-}{-}-------{-}++{-}--------------}}
> {{| Table | Non_unique | Key_name | Seq_in_index |
> Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type
> | Comment | Index_comment |}}
> {{{+}--------------------------------{-}{-}{+}----------{-}++{-}--------{-}{-}------------{-}++{-}-----------{-}{-}---------{-}++{-}-----------{-}{-}--------{-}++{-}------{-}{-}----{-}++{-}----------{-}{-}-------{-}++{-}--------------}}
> {{| m_selfservice_beneficiaries_tpt | 0 | PRIMARY | 1 |
> id | A | 1 | NULL | NULL | | BTREE
> | | |}}
> {{| m_selfservice_beneficiaries_tpt | 0 | name | 1 |
> name | A | 1 | NULL | NULL | | BTREE
> | | |}}
> {{| m_selfservice_beneficiaries_tpt | 0 | name | 2 |
> app_user_id | A | 1 | NULL | NULL | | BTREE
> | | |}}
> {{| m_selfservice_beneficiaries_tpt | 0 | name | 3 |
> is_active | A | 1 | NULL | NULL | | BTREE
> | | |}}
> {{{+}--------------------------------{-}{-}{+}----------{-}++{-}--------{-}{-}------------{-}++{-}-----------{-}{-}---------{-}++{-}-----------{-}{-}--------{-}++{-}------{-}{-}----{-}++{-}----------{-}{-}-------{-}++{-}--------------}}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)