<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<rewrite-assertions yaml-rule="yaml/mix/query-with-cipher.yaml">
    <rewrite-assertion id="insert_values_with_columns_with_id_for_parameters">
        <input sql="INSERT INTO t_account(account_id, password, amount, status) VALUES (?, ?, ?, ?), (2, 'bbb', 2000, 'OK'), (?, ?, ?, ?), (4, 'ddd', 4000, 'OK')" parameters="1, aaa, 1000, OK, 3, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_1(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)" parameters="1, encrypt_aaa, assisted_query_aaa, encrypt_1000, OK, 3, encrypt_ccc, assisted_query_ccc, encrypt_3000, OK" />
        <output sql="INSERT INTO t_account_0(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_with_id_for_literals">
        <input sql="INSERT INTO t_account(account_id, password, amount, status) VALUES (1, 'aaa', 1000, 'OK'), (2, 'bbb', 2000, 'OK'), (3, 'ccc', 3000, 'OK'), (4, 'ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_1(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (1, 'encrypt_aaa', 'assisted_query_aaa', 'encrypt_1000', 'OK'), (3, 'encrypt_ccc', 'assisted_query_ccc', 'encrypt_3000', 'OK')" />
        <output sql="INSERT INTO t_account_0(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_without_id_for_parameters">
        <input sql="INSERT INTO t_account(password, amount, status) VALUES (?, ?, ?), ('bbb', 2000, 'OK'), (?, ?, ?), ('ddd', 4000, 'OK')" parameters="aaa, 1000, OK, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_1(cipher_password, assisted_query_password, cipher_amount, status, account_id) VALUES (?, ?, ?, ?, ?), ('encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK', 1), (?, ?, ?, ?, ?), ('encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK', 1)" parameters="encrypt_aaa, assisted_query_aaa, encrypt_1000, OK, 1, encrypt_ccc, assisted_query_ccc, encrypt_3000, OK, 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_without_id_for_literals">
        <input sql="INSERT INTO t_account(password, amount, status) VALUES ('aaa', 1000, 'OK'), ('bbb', 2000, 'OK'), ('ccc', 3000, 'OK'), ('ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_1(cipher_password, assisted_query_password, cipher_amount, status, account_id) VALUES ('encrypt_aaa', 'assisted_query_aaa', 'encrypt_1000', 'OK', 1), ('encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK', 1), ('encrypt_ccc', 'assisted_query_ccc', 'encrypt_3000', 'OK', 1), ('encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK', 1)" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_with_plain_with_id_for_parameters">
        <input sql="INSERT INTO t_account_bak(account_id, password, amount, status) VALUES (?, ?, ?, ?), (2, 'bbb', 2000, 'OK'), (?, ?, ?, ?), (4, 'ddd', 4000, 'OK')" parameters="1, aaa, 1000, OK, 3, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_bak_1(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?)" parameters="1, encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1000, OK, 3, encrypt_ccc, assisted_query_ccc, ccc, encrypt_3000, 3000, OK" />
        <output sql="INSERT INTO t_account_bak_0(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_with_plain_with_id_for_literals">
        <input sql="INSERT INTO t_account_bak(account_id, password, amount, status) VALUES (1, 'aaa', 1000, 'OK'), (2, 'bbb', 2000, 'OK'), (3, 'ccc', 3000, 'OK'), (4, 'ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_bak_1(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (1, 'encrypt_aaa', 'assisted_query_aaa', 'aaa', 'encrypt_1000', 1000, 'OK'), (3, 'encrypt_ccc', 'assisted_query_ccc', 'ccc', 'encrypt_3000', 3000, 'OK')" />
        <output sql="INSERT INTO t_account_bak_0(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_with_plain_without_id_for_parameters">
        <input sql="INSERT INTO t_account_bak(password, amount, status) VALUES (?, ?, ?), ('bbb', 2000, 'OK'), (?, ?, ?), ('ddd', 4000, 'OK')" parameters="aaa, 1000, OK, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_bak_1(cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status, account_id) VALUES (?, ?, ?, ?, ?, ?, ?), ('encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK', 1), (?, ?, ?, ?, ?, ?, ?), ('encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK', 1)" parameters="encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1000, OK, 1, encrypt_ccc, assisted_query_ccc, ccc, encrypt_3000, 3000, OK, 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_with_columns_with_plain_without_id_for_literals">
        <input sql="INSERT INTO t_account_bak(password, amount, status) VALUES ('aaa', 1000, 'OK'), ('bbb', 2000, 'OK'), ('ccc', 3000, 'OK'), ('ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_bak_1(cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status, account_id) VALUES ('encrypt_aaa', 'assisted_query_aaa', 'aaa', 'encrypt_1000', 1000, 'OK', 1), ('encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK', 1), ('encrypt_ccc', 'assisted_query_ccc', 'ccc', 'encrypt_3000', 3000, 'OK', 1), ('encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK', 1)" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_with_id_for_parameters">
        <input sql="INSERT INTO t_account(account_id, password, amount, status) VALUES (?, ?, ?, ?), (2, 'bbb', 2000, 'OK'), (?, ?, ?, ?), (4, 'ddd', 4000, 'OK')" parameters="1, aaa, 1000, OK, 3, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_1(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (?, ?, ?, ?, ?), (?, ?, ?, ?, ?)" parameters="1, encrypt_aaa, assisted_query_aaa, encrypt_1000, OK, 3, encrypt_ccc, assisted_query_ccc, encrypt_3000, OK" />
        <output sql="INSERT INTO t_account_0(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_with_id_for_literals">
        <input sql="INSERT INTO t_account VALUES (1, 'aaa', 1000, 'OK'), (2, 'bbb', 2000, 'OK'), (3, 'ccc', 3000, 'OK'), (4, 'ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_1(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (1, 'encrypt_aaa', 'assisted_query_aaa', 'encrypt_1000', 'OK'), (3, 'encrypt_ccc', 'assisted_query_ccc', 'encrypt_3000', 'OK')" />
        <output sql="INSERT INTO t_account_0(account_id, cipher_password, assisted_query_password, cipher_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_without_id_for_parameters">
        <input sql="INSERT INTO t_account VALUES (?, ?, ?), ('bbb', 2000, 'OK'), (?, ?, ?), ('ddd', 4000, 'OK')" parameters="aaa, 1000, OK, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_1(cipher_password, assisted_query_password, cipher_amount, status, account_id) VALUES (?, ?, ?, ?, ?), ('encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK', 1), (?, ?, ?, ?, ?), ('encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK', 1)" parameters="encrypt_aaa, assisted_query_aaa, encrypt_1000, OK, 1, encrypt_ccc, assisted_query_ccc, encrypt_3000, OK, 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_without_id_for_literals">
        <input sql="INSERT INTO t_account VALUES ('aaa', 1000, 'OK'), ('bbb', 2000, 'OK'), ('ccc', 3000, 'OK'), ('ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_1(cipher_password, assisted_query_password, cipher_amount, status, account_id) VALUES ('encrypt_aaa', 'assisted_query_aaa', 'encrypt_1000', 'OK', 1), ('encrypt_bbb', 'assisted_query_bbb', 'encrypt_2000', 'OK', 1), ('encrypt_ccc', 'assisted_query_ccc', 'encrypt_3000', 'OK', 1), ('encrypt_ddd', 'assisted_query_ddd', 'encrypt_4000', 'OK', 1)" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_with_plain_with_id_for_parameters">
        <input sql="INSERT INTO t_account_bak VALUES (?, ?, ?, ?), (2, 'bbb', 2000, 'OK'), (?, ?, ?, ?), (4, 'ddd', 4000, 'OK')" parameters="1, aaa, 1000, OK, 3, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_bak_1(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (?, ?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?, ?)" parameters="1, encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1000, OK, 3, encrypt_ccc, assisted_query_ccc, ccc, encrypt_3000, 3000, OK" />
        <output sql="INSERT INTO t_account_bak_0(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_with_plain_with_id_for_literals">
        <input sql="INSERT INTO t_account_bak VALUES (1, 'aaa', 1000, 'OK'), (2, 'bbb', 2000, 'OK'), (3, 'ccc', 3000, 'OK'), (4, 'ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_bak_1(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (1, 'encrypt_aaa', 'assisted_query_aaa', 'aaa', 'encrypt_1000', 1000, 'OK'), (3, 'encrypt_ccc', 'assisted_query_ccc', 'ccc', 'encrypt_3000', 3000, 'OK')" />
        <output sql="INSERT INTO t_account_bak_0(account_id, cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status) VALUES (2, 'encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK'), (4, 'encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK')" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_with_plain_without_id_for_parameters">
        <input sql="INSERT INTO t_account_bak VALUES (?, ?, ?), ('bbb', 2000, 'OK'), (?, ?, ?), ('ddd', 4000, 'OK')" parameters="aaa, 1000, OK, ccc, 3000, OK" />
        <output sql="INSERT INTO t_account_bak_1(cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status, account_id) VALUES (?, ?, ?, ?, ?, ?, ?), ('encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK', 1), (?, ?, ?, ?, ?, ?, ?), ('encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK', 1)" parameters="encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1000, OK, 1, encrypt_ccc, assisted_query_ccc, ccc, encrypt_3000, 3000, OK, 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_values_without_columns_with_plain_without_id_for_literals">
        <input sql="INSERT INTO t_account_bak VALUES ('aaa', 1000, 'OK'), ('bbb', 2000, 'OK'), ('ccc', 3000, 'OK'), ('ddd', 4000, 'OK')" />
        <output sql="INSERT INTO t_account_bak_1(cipher_password, assisted_query_password, plain_password, cipher_amount, plain_amount, status, account_id) VALUES ('encrypt_aaa', 'assisted_query_aaa', 'aaa', 'encrypt_1000', 1000, 'OK', 1), ('encrypt_bbb', 'assisted_query_bbb', 'bbb', 'encrypt_2000', 2000, 'OK', 1), ('encrypt_ccc', 'assisted_query_ccc', 'ccc', 'encrypt_3000', 3000, 'OK', 1), ('encrypt_ddd', 'assisted_query_ddd', 'ddd', 'encrypt_4000', 4000, 'OK', 1)" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_with_id_for_parameters" db-type="MySQL">
        <input sql="INSERT INTO t_account SET account_id = ?, password = ?, amount = ?, status = ?" parameters="1, aaa, 1000, OK" />
        <output sql="INSERT INTO t_account_1 SET account_id = ?, cipher_password = ?, assisted_query_password = ?, cipher_amount = ?, status = ?" parameters="1, encrypt_aaa, assisted_query_aaa, encrypt_1000, OK" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_with_id_for_literals" db-type="MySQL">
        <input sql="INSERT INTO t_account SET account_id = 1, password = 'aaa', amount = 1000, status = 'OK'" />
        <output sql="INSERT INTO t_account_1 SET account_id = 1, cipher_password = 'encrypt_aaa', assisted_query_password = 'assisted_query_aaa', cipher_amount = 'encrypt_1000', status = 'OK'" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_without_id_for_parameters" db-type="MySQL">
        <input sql="INSERT INTO t_account SET password = ?, amount = ?, status = ?" parameters="aaa, 1000, OK" />
        <output sql="INSERT INTO t_account_1 SET cipher_password = ?, assisted_query_password = ?, cipher_amount = ?, status = ?, account_id = ?" parameters="encrypt_aaa, assisted_query_aaa, encrypt_1000, OK, 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_without_id_for_literals" db-type="MySQL">
        <input sql="INSERT INTO t_account SET password = 'aaa', amount = 1000, status = 'OK'" />
        <output sql="INSERT INTO t_account_1 SET cipher_password = 'encrypt_aaa', assisted_query_password = 'assisted_query_aaa', cipher_amount = 'encrypt_1000', status = 'OK', account_id = 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_with_plain_with_id_for_parameters" db-type="MySQL">
        <input sql="INSERT INTO t_account_bak SET account_id = ?, password = ?, amount = ?, status = ?" parameters="1, aaa, 1000, OK" />
        <output sql="INSERT INTO t_account_bak_1 SET account_id = ?, cipher_password = ?, assisted_query_password = ?, plain_password = ?, cipher_amount = ?, plain_amount = ?, status = ?" parameters="1, encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1000, OK" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_without_plain_with_id_for_parameters" db-type="MySQL">
        <input sql="INSERT INTO t_account_bak SET password = ?, amount = ?, status = ?" parameters="aaa, 1000, OK" />
        <output sql="INSERT INTO t_account_bak_1 SET cipher_password = ?, assisted_query_password = ?, plain_password = ?, cipher_amount = ?, plain_amount = ?, status = ?, account_id = ?" parameters="encrypt_aaa, assisted_query_aaa, aaa, encrypt_1000, 1000, OK, 1" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_with_plain_with_id_for_literals" db-type="MySQL">
        <input sql="INSERT INTO t_account_bak SET account_id = 1, password = 'aaa', amount = 1000, status = 'OK'" />
        <output sql="INSERT INTO t_account_bak_1 SET account_id = 1, cipher_password = 'encrypt_aaa', assisted_query_password = 'assisted_query_aaa', plain_password = 'aaa', cipher_amount = 'encrypt_1000', plain_amount = 1000, status = 'OK'" />
    </rewrite-assertion>
    
    <rewrite-assertion id="insert_set_with_plain_without_id_for_literals" db-type="MySQL">
        <input sql="INSERT INTO t_account_bak SET password = 'aaa', amount = 1000, status = 'OK'" />
        <output sql="INSERT INTO t_account_bak_1 SET cipher_password = 'encrypt_aaa', assisted_query_password = 'assisted_query_aaa', plain_password = 'aaa', cipher_amount = 'encrypt_1000', plain_amount = 1000, status = 'OK', account_id = 1" />
    </rewrite-assertion>
</rewrite-assertions>
