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

fix(tianmu): the instance crashed while exporting data (#1961) #1964

Open
wants to merge 3 commits into
base: stonedb-5.7-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mysql-test/suite/tianmu/std_data/issue1961.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"1" "108"
25 changes: 25 additions & 0 deletions mysql-test/suite/tianmu/t/issue1961.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--source include/have_tianmu.inc

--disable_warnings
DROP DATABASE IF EXISTS issue1961_test;
--enable_warnings

CREATE DATABASE issue1961_test;

USE issue1961_test;

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a int(11) DEFAULT 0,b bit(9) DEFAULT NULL) ENGINE=TIANMU;
INSERT INTO t1 VALUES (1,B'1101100');

--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select * from t1 into outfile '$MYSQLTEST_VARDIR/tmp/issue1961_out.txt' FIELDS TERMINATED BY ' ' ENCLOSED BY '"' LINES TERMINATED BY '\n';

--diff_files $MYSQL_TEST_DIR/suite/tianmu/std_data/issue1961.txt $MYSQLTEST_VARDIR/tmp/issue1961_out.txt
--remove_file $MYSQLTEST_VARDIR/tmp/issue1961_out.txt

DROP TABLE t1;

DROP DATABASE issue1961_test;
4 changes: 4 additions & 0 deletions storage/tianmu/core/engine_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,10 @@ AttributeTypeInfo Engine::GetCorrespondingATI(Field &field) {
common::ColumnType at = GetCorrespondingType(field);

if (ATI::IsNumericType(at)) {
if (at == common::ColumnType::BIT) {
DEBUG_ASSERT(dynamic_cast<Field_bit *>(&field));
return AttributeTypeInfo(at, !field.maybe_null(), field.field_length);
}
DEBUG_ASSERT(dynamic_cast<Field_num *>(&field));
if (at == common::ColumnType::NUM) {
DEBUG_ASSERT(dynamic_cast<Field_new_decimal *>(&field));
Expand Down
Loading