Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ERROR 1105 (HY000): assert failed on cur_pack != nullptr at tianmu_attr.cpp:401, msg: [Pack ptr is null] #1188

Closed
3 tasks done
haitaoguan opened this issue Jan 3, 2023 · 1 comment · Fixed by #1235
Assignees
Labels
A-bug Something isn't working B-DDL DDL related issues B-stability Improve stonedb stabilization on different platform or arch prio: high High priority

Comments

@haitaoguan
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

create table ttt(id int,name varchar(5));
insert into ttt values(1,'AAA'),(2,'BBB');
alter table ttt add column age varchar(5) not null;

mysql> show create table ttt\G
*************************** 1. row ***************************
       Table: ttt
Create Table: CREATE TABLE `ttt` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(5) DEFAULT NULL,
  `age` varchar(5) NOT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4
1 row in set (0.00 sec)

mysql> select * from ttt;
ERROR 1105 (HY000): assert failed on cur_pack != nullptr at tianmu_attr.cpp:401, msg: [Pack ptr is null]

###tianmu.log
[2023-01-03 14:22:24.726570] [17918] [WARN] [exception.cpp:42] MSG: Exception: assert failed on cur_pack != nullptr at tianmu_attr.cpp:401, msg: [Pack ptr is null].

STACK TRACE BEGIN
        /stonedb57/install/bin/mysqld(Tianmu::common::AssertException::AssertException(char const*, char const*, int, std::string const&)+0x317) [0x1778957]
        /stonedb57/install/bin/mysqld() [0x97ad68]
        /stonedb57/install/bin/mysqld(non-virtual thunk to Tianmu::core::TianmuAttr::GetNotNullValueString(long, Tianmu::types::BString&)+0x25) [0x1635f05]
        /stonedb57/install/bin/mysqld(Tianmu::core::TempTable::SendResult(long, long, Tianmu::core::ResultSender&, bool)+0xb51) [0x161dfc1]
        /stonedb57/install/bin/mysqld(Tianmu::core::TempTable::FillMaterializedBuffers(long, long, Tianmu::core::ResultSender*, bool)+0x50) [0x161e1c0]
        /stonedb57/install/bin/mysqld(Tianmu::core::TempTable::Materialize(bool, Tianmu::core::ResultSender*, bool)+0xb64) [0x1612914]
        /stonedb57/install/bin/mysqld(Tianmu::core::Engine::Execute(THD*, LEX*, Query_result*, st_select_lex_unit*)+0x9d6) [0x15d6ad6]
        /stonedb57/install/bin/mysqld(Tianmu::core::Engine::HandleSelect(THD*, LEX*, Query_result*&, unsigned long, int&, int&, int&, int)+0x8ca) [0x15d76aa]
        /stonedb57/install/bin/mysqld(Tianmu::handler::ha_my_tianmu_query(THD*, LEX*, Query_result*&, unsigned long, int&, int&, int&, int)+0x36) [0x1665166]
        /stonedb57/install/bin/mysqld() [0xfb25d8]
        /stonedb57/install/bin/mysqld(mysql_execute_command(THD*, bool)+0x4b03) [0xfb9b83]
        /stonedb57/install/bin/mysqld(mysql_parse(THD*, Parser_state*)+0x425) [0xfbbe05]
        /stonedb57/install/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x1599) [0xfbd409]
        /stonedb57/install/bin/mysqld(do_command(THD*)+0x207) [0xfbe127]
        /stonedb57/install/bin/mysqld(handle_connection+0x2b8) [0x1076298]
        /stonedb57/install/bin/mysqld(pfs_spawn_thread+0x164) [0x154dae4]
        /lib64/libpthread.so.0(+0x81a3) [0x7fe42ded51a3]
        /lib64/libc.so.6(clone+0x6d) [0x7fe42b364fad]
STACK TRACE END

[2023-01-03 14:22:24.726797] [17918] [INFO] [engine_execute.cpp:514] MSG: Query terminated with exception: select * from ttt

Expected behavior

No error

How To Reproduce

No response

Environment

./mysqld Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: 0bc2cbe
Last commit time: Date: Fri Dec 30 17:46:55 2022 +0800
Build time: Date: Tue Jan 3 09:59:43 CST 2023

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@haitaoguan haitaoguan added the A-bug Something isn't working label Jan 3, 2023
@wisehead wisehead assigned DandreChen and unassigned adofsauron and DandreChen Jan 6, 2023
@wisehead wisehead added this to the stonedb_5.7_v1.0.2 milestone Jan 6, 2023
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 6, 2023
fix assert failed when alter table add column not null
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 6, 2023
fix assert failed when alter table add column not null
@wisehead wisehead added B-DDL DDL related issues B-stability Improve stonedb stabilization on different platform or arch labels Jan 9, 2023
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 10, 2023
fix assert failed when alter table add column not null
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 17, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Jan 17, 2023
Convert alter table add column not null to use copy algorithm.
@DandreChen
Copy link
Collaborator

case:

CREATE TABLE tb1(id int,name varchar(5)) ENGINE=TIANMU;
INSERT INTO tb1 VALUES(1,'AAA'),(2,'BBB');
ALTER TABLE tb1 ADD COLUMN age VARCHAR(5) NOT NULL;
ALTER TABLE tb1 ADD COLUMN score INT NOT NULL;
SELECT * FROM tb1;

test:

mysql> CREATE TABLE tb1(id int,name varchar(5)) ENGINE=TIANMU;
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO tb1 VALUES(1,'AAA'),(2,'BBB');
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> ALTER TABLE tb1 ADD COLUMN age VARCHAR(5) NOT NULL;
Query OK, 2 rows affected (5.20 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> ALTER TABLE tb1 ADD COLUMN score INT NOT NULL;
Query OK, 2 rows affected (0.03 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> SELECT * FROM tb1;
+------+------+-----+-------+
| id   | name | age | score |
+------+------+-----+-------+
|    1 | AAA  |     |     0 |
|    2 | BBB  |     |     0 |
+------+------+-----+-------+
2 rows in set (0.00 sec)

mysql> show create table tb1;
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                                                                        |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tb1   | CREATE TABLE `tb1` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(5) DEFAULT NULL,
  `age` varchar(5) NOT NULL,
  `score` int(11) NOT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4 |
+-------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>

@wisehead wisehead added the prio: high High priority label Jan 30, 2023
@hustjieke hustjieke moved this to In Progress in StoneDB for MySQL 5.7 Jan 30, 2023
@hustjieke hustjieke added B-storage data type, data storage, insert,update,delete, transactions and removed B-storage data type, data storage, insert,update,delete, transactions labels Jan 30, 2023
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 3, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 3, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 3, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 3, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 3, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 9, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 10, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 14, 2023
Convert alter table add column not null to use copy algorithm.
DandreChen added a commit to DandreChen/stonedb that referenced this issue Feb 14, 2023
Convert alter table add column not null to use copy algorithm.
@mergify mergify bot closed this as completed in #1235 Feb 15, 2023
mergify bot pushed a commit that referenced this issue Feb 15, 2023
Convert alter table add column not null to use copy algorithm.
@github-project-automation github-project-automation bot moved this from In Progress to Done in StoneDB for MySQL 5.7 Feb 15, 2023
isredstar pushed a commit to isredstar/stonedb that referenced this issue Feb 15, 2023
Convert alter table add column not null to use copy algorithm.
mergify bot pushed a commit that referenced this issue Feb 27, 2023
Convert alter table add column not null to use copy algorithm.
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
Convert alter table add column not null to use copy algorithm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working B-DDL DDL related issues B-stability Improve stonedb stabilization on different platform or arch prio: high High priority
Projects
5 participants