Closed madhur closed 11 months ago
The error seems to be related to providing value now(3)
in insert values.
I cannot repeat the issue on main or v17.0.4:
git checkout v17.0.4
make build
pushd examples/local
./101_initial_cluster.sh
echo "create table test (id int not null auto_increment primary key, ts timestamp);
insert into test values (1, now(3));
CREATE TABLE contest_user_team_mapping ( id bigint NOT NULL, user_match_mapping_id bigint NOT NULL, contest_id bigint NOT
NULL, entry_fee_type int DEFAULT NULL, channel_id int DEFAULT NULL, updated_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, ticket_source int DEFAULT NULL, ticket_discount decimal(10,2) DEFAULT NULL, entry_fee decimal(10,2) DEFAULT NULL, match_id bigint DEFAULT NULL, multiplier decimal(5,2) DEFAULT NULL, lb_id bigint DEFAULT NULL, additional_info text CHARACTER SET utf8 COLLATE utf8_general_ci, user_id bigint DEFAULT NULL, bucket_id bigint DEFAULT NULL, created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id), UNIQUE KEY contest_user (contest_id,user_match_mapping_id), KEY idx_contest_id (contest_id), KEY idx_updated_at (updated_at), KEY idx_match_id (match_id,id), KEY idx_user_id (user_id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
insert into contest_user_team_mapping (id, user_match_mapping_id,contest_id,entry_fee_type,channel_id,ticket_source,ticket_discount,entry_fee,match_id,multiplier, lb_id, additional_info,user_id,bucket_id,created_at) values (1, 1, 2, 3,4,null,null,10.0,10,null, null, null, 1, null, now(3));" | mysql
I got an error trying to do the insert w/o the ID value. I'm guessing that you have that using a sequence on your side.
So clearly there's something else missing here. You didn't share other details like the MySQL version (8.0.34 in my case) or Vitess config flags (vtgate and vttablet).
Hi Matt
This will be reproducible if vtgate are on v16 and vttablets are on v17.
We saw this error during upgrade procedure. It works fine when enter stack is on v17.
On Sat, Dec 9, 2023, 20:52 Matt Lord @.***> wrote:
I cannot repeat the issue on main or v17.0.4:
git checkout v17.0.4 make build
pushd examples/local
./101_initial_cluster.sh
echo "create table test (id int not null auto_increment primary key, ts timestamp); insert into test values (1, now(3)); CREATE TABLE
contest_user_team_mapping
(id
bigint NOT NULL,user_match_mapping_id
bigint NOT NULL,contest_id
bigint NOT NULL,entry_fee_type
int DEFAULT NULL,channel_id
int DEFAULT NULL,updated_at
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,ticket_source
int DEFAULT NULL,ticket_discount
decimal(10,2) DEFAULT NULL,entry_fee
decimal(10,2) DEFAULT NULL,match_id
bigint DEFAULT NULL,multiplier
decimal(5,2) DEFAULT NULL,lb_id
bigint DEFAULT NULL,additional_info
text CHARACTER SET utf8 COLLATE utf8_general_ci,user_id
bigint DEFAULT NULL,bucket_id
bigint DEFAULT NULL,created_at
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (id
), UNIQUE KEYcontest_user
(contest_id
,user_match_mapping_id
), KEYidx_contest_id
(contest_id
), KEYidx_updated_at
(updated_at
), KEYidx_match_id
(match_id
,id
), KEYidx_user_id
(user_id
) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;insert into contest_user_team_mapping (id, user_match_mapping_id,contest_id,entry_fee_type,channel_id,ticket_source,ticket_discount,entry_fee,match_id,multiplier, lb_id, additional_info,user_id,bucket_id,created_at) values (1, 1, 2, 3,4,null,null,10.0,10,null, null, null, 1, null, now(3));
I got an error trying to do the insert w/o the ID value. I'm guessing that you have that using a sequence on your side.
So clearly there's something else missing here. You didn't share other details like the MySQL version (8.0.34 in my case) or Vitess config flags (vtgate and vttablet).
— Reply to this email directly, view it on GitHub https://github.com/vitessio/vitess/issues/14740#issuecomment-1848438874, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD4L52W6VX4MSKV7SNB7DTYIR64XAVCNFSM6AAAAABANVMXFKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBYGQZTQOBXGQ . You are receiving this because you authored the thread.Message ID: @.***>
I confirm select now(:v1)
parses on v16 but fails on v17. Looks like a parser regression.
Is there any workaround for upgrade?
Is there any workaround for upgrade?
There are two workaround here:
normalize_queries
vtgate flagWe plan to fix this issue and release a patch next week.
This fix has been merged in release-17.0. #14763 The next time we do a patch release for this branch, that minor version would not have this problem. Thank-you for reporting this issue @madhur
Overview of the Issue
We are seeing complete insert failures on our table which was working fine on vitess v16.0.2.
After doing rolling upgrades on our tablets from v16.0.2-> v17.0.4. When we switched over the primary tablet to vitess v17.0.4 version, we can see complete failures.
Reproduction Steps: Create a vschema
Reproduction Steps
Apply the insert statement
Output:
Binary Version
Operating System and Environment details
Log Fragments