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: Field "a$1、$b、c$" insert value, no query result #222

Closed
1 task
shangyanwen opened this issue Jul 14, 2022 · 3 comments · Fixed by #427
Closed
1 task

bug: Field "a$1、$b、c$" insert value, no query result #222

shangyanwen opened this issue Jul 14, 2022 · 3 comments · Fixed by #427
Assignees
Labels
A-bug Something isn't working prio: high High priority

Comments

@shangyanwen
Copy link
Contributor

shangyanwen commented Jul 14, 2022

Describe the problem

1、create database mysqltest;
2、create table mysqltest.$test1 (a$1 int, $b int, c$ int)engine=stonedb;
3、insert into mysqltest.$test1 values (1,2,3);
4、select a$1, $b, c$ from mysqltest.$test1;
Empty set (0.00 sec)

Expected behavior

select a$1, $b, c$ from mysqltest.$test11;
+------+------+------+
| a$1  | $b   | c$   |
+------+------+------+
|    1 |    2 |    3 |
+------+------+------+
1 row in set (0.00 sec)

How To Reproduce

1、create database mysqltest;
2、create table mysqltest.$test1 (a$1 int, $b int, c$ int)engine=stonedb;
3、insert into mysqltest.$test1 values (1,2,3);
4、select a$1, $b, c$ from mysqltest.$test1;

Environment

  1. StoneDB for mysql5.7
  2. Ubuntu 20.04.4

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

  • Yes, I will!
@shangyanwen shangyanwen added the A-bug Something isn't working label Jul 14, 2022
@shangyanwen shangyanwen changed the title bug: Field "a$1""$b""" insert value, no query result bug: Field "a$1""$b""c$" insert value, no query result Jul 14, 2022
@shangyanwen shangyanwen changed the title bug: Field "a$1""$b""c$" insert value, no query result bug: Field "a$1\$b""c$" insert value, no query result Jul 14, 2022
@shangyanwen shangyanwen changed the title bug: Field "a$1\$b""c$" insert value, no query result bug: Field "a$1、$b、c$" insert value, no query result Jul 14, 2022
@hustjieke hustjieke added the prio: high High priority label Jul 17, 2022
@lylth
Copy link
Contributor

lylth commented Jul 24, 2022

Insert data process, rocksdb returns success.
stonedb stack

rocksdb::DBImpl::WriteImpl(rocksdb::DBImpl * const this, const rocksdb::WriteOptions & write_options, rocksdb::WriteBatch * my_batch, rocksdb::WriteCallback * callback, uint64_t * log_used, uint64_t log_ref, bool disable_memtable, uint64_t * seq_used, size_t batch_cnt, rocksdb::PreReleaseCallback * pre_release_callback) (\opt\prepare\rocksdb-6.12.6\db\db_impl\db_impl_write.cc:124)
rocksdb::DBImpl::Write(rocksdb::DBImpl * const this,  write_options, rocksdb::WriteBatch * my_batch) (\opt\prepare\rocksdb-6.12.6\db\db_impl\db_impl_write.cc:53)
stonedb::index::KVStore::KVWriteBatch(stonedb::index::KVStore * const this, rocksdb::WriteOptions & wopts, rocksdb::WriteBatch * batch) (\opt\lth\stonedb\storage\stonedb\index\kv_store.cpp:254)
stonedb::index::KVTransaction::Commit(stonedb::index::KVTransaction * const this) (\opt\lth\stonedb\storage\stonedb\index\kv_transaction.cpp:101)
stonedb::core::RCMemTable::InsertRow(stonedb::core::RCMemTable * const this, std::unique_ptr<char [], std::default_delete<char []> > buf, uint32_t size) (\opt\lth\stonedb\storage\stonedb\core\rc_mem_table.cpp:132)
stonedb::core::RCTable::InsertMemRow(stonedb::core::RCTable * const this, std::unique_ptr<char [], std::default_delete<char []> > buf, uint32_t size) (\opt\lth\stonedb\storage\stonedb\core\rc_table.cpp:1258)
stonedb::core::Engine::InsertMemRow(stonedb::core::Engine * const this, const std::string & table_path, std::shared_ptr<stonedb::core::TableShare> & share, TABLE * table) (\opt\lth\stonedb\storage\stonedb\core\engine.cpp:1423)
stonedb::core::Engine::InsertRow(stonedb::core::Engine * const this, const std::string & table_path, stonedb::core::Transaction * trans, TABLE * table, std::shared_ptr<stonedb::core::TableShare> & share) (\opt\lth\stonedb\storage\stonedb\core\engine.cpp:1432)
stonedb::dbhandler::StonedbHandler::write_row(stonedb::dbhandler::StonedbHandler * const this, uchar * buf) (\opt\lth\stonedb\storage\stonedb\handler\stonedb_handler.cpp:421)
handler::ha_write_row(handler * const this, uchar * buf) (\opt\lth\stonedb\sql\handler.cc:8188)
write_record(THD * thd, TABLE * table, COPY_INFO * info, COPY_INFO * update) (\opt\lth\stonedb\sql\sql_insert.cc:1902)
Sql_cmd_insert::mysql_insert(Sql_cmd_insert * const this, THD * thd, TABLE_LIST * table_list) (\opt\lth\stonedb\sql\sql_insert.cc:776)
Sql_cmd_insert::execute(Sql_cmd_insert * const this, THD * thd) (\opt\lth\stonedb\sql\sql_insert.cc:3149)
mysql_execute_command(THD * thd, bool first_level) (\opt\lth\stonedb\sql\sql_parse.cc:3619)
mysql_parse(THD * thd, Parser_state * parser_state) (\opt\lth\stonedb\sql\sql_parse.cc:5621)
dispatch_command(THD * thd, const COM_DATA * com_data, enum_server_command command) (\opt\lth\stonedb\sql\sql_parse.cc:1495)
do_command(THD * thd) (\opt\lth\stonedb\sql\sql_parse.cc:1034)
handle_connection(void * arg) (\opt\lth\stonedb\sql\conn_handler\connection_handler_per_thread.cc:313)
pfs_spawn_thread(void * arg) (\opt\lth\stonedb\storage\perfschema\pfs.cc:2197)
libpthread.so.0!start_thread (未知源:0)

@lylth
Copy link
Contributor

lylth commented Jul 24, 2022

There is an exception in the rocksdb AsyncDropData process.

StripeRep(rocksdb::SequenceNumber lower_bound, rocksdb::SequenceNumber upper_bound, const rocksdb::InternalKeyComparator * icmp, rocksdb::RangeDelAggregator::StripeRep * const this) (\opt\prepare\rocksdb-6.12.6\db\range_del_aggregator.h:311)
ReadRangeDelAggregator(rocksdb::SequenceNumber upper_bound, const rocksdb::InternalKeyComparator * icmp, rocksdb::ReadRangeDelAggregator * const this) (\opt\prepare\rocksdb-6.12.6\db\range_del_aggregator.h:359)
rocksdb::DBIter::DBIter(rocksdb::DBIter * const this, rocksdb::Env * _env, const rocksdb::ReadOptions & read_options, const rocksdb::ImmutableCFOptions & cf_options, const rocksdb::MutableCFOptions & mutable_cf_options, const rocksdb::Comparator * cmp, rocksdb::InternalIterator * iter, rocksdb::SequenceNumber s, bool arena_mode, uint64_t max_sequential_skip_in_iterations, rocksdb::ReadCallback * read_callback, rocksdb::DBImpl * db_impl, rocksdb::ColumnFamilyData * cfd, bool allow_blob) (\opt\prepare\rocksdb-6.12.6\db\db_iter.cc:77)
rocksdb::ArenaWrappedDBIter::Init(rocksdb::ArenaWrappedDBIter * const this, rocksdb::Env * env, const rocksdb::ReadOptions & read_options, const rocksdb::ImmutableCFOptions & cf_options, const rocksdb::MutableCFOptions & mutable_cf_options, const rocksdb::SequenceNumber & sequence, uint64_t max_sequential_skip_in_iteration, uint64_t version_number, rocksdb::ReadCallback * read_callback, rocksdb::DBImpl * db_impl, rocksdb::ColumnFamilyData * cfd, bool allow_blob, bool allow_refresh) (\opt\prepare\rocksdb-6.12.6\db\arena_wrapped_db_iter.cc:46)
rocksdb::NewArenaWrappedDbIterator(rocksdb::Env * env, const rocksdb::ReadOptions & read_options, const rocksdb::ImmutableCFOptions & cf_options, const rocksdb::MutableCFOptions & mutable_cf_options, const rocksdb::SequenceNumber & sequence, unsigned long max_sequential_skip_in_iterations, uint64_t version_number, rocksdb::ReadCallback * read_callback, rocksdb::DBImpl * db_impl, rocksdb::ColumnFamilyData * cfd, bool allow_blob, bool allow_refresh) (\opt\prepare\rocksdb-6.12.6\db\arena_wrapped_db_iter.cc:97)
rocksdb::DBImpl::NewIteratorImpl(rocksdb::DBImpl * const this, const rocksdb::ReadOptions & read_options, rocksdb::ColumnFamilyData * cfd, rocksdb::SequenceNumber snapshot, rocksdb::ReadCallback * read_callback, bool allow_blob, bool allow_refresh) (\opt\prepare\rocksdb-6.12.6\db\db_impl\db_impl.cc:2830)
rocksdb::DBImpl::NewIterator(rocksdb::DBImpl * const this, const rocksdb::ReadOptions & read_options, rocksdb::ColumnFamilyHandle * column_family) (\opt\prepare\rocksdb-6.12.6\db\db_impl\db_impl.cc:2749)
stonedb::index::DICTManager::get_ongoing_index(const stonedb::index::DICTManager * const this, std::vector<stonedb::index::GlobalId, std::allocator<stonedb::index::GlobalId> > & ids, stonedb::index::MetaType dd_type) (\opt\lth\stonedb\storage\stonedb\index\rdb_meta_manager.cpp:887)
stonedb::index::KVStore::AsyncDropData(stonedb::index::KVStore * const this) (\opt\lth\stonedb\storage\stonedb\index\kv_store.cpp:112)
stonedb::index::KVStore::<lambda()>::operator()(void) const(const stonedb::index::KVStore::<lambda()> * const __closure) (\opt\lth\stonedb\storage\stonedb\index\kv_store.cpp:85)
std::__invoke_impl<void, stonedb::index::KVStore::Init()::<lambda()> >(std::__invoke_other, stonedb::index::KVStore::<lambda()> &)(stonedb::index::KVStore::<lambda()> & __f) (\opt\rh\devtoolset-7\root\usr\include\c++\7\bits\invoke.h:60)
std::__invoke<stonedb::index::KVStore::Init()::<lambda()> >(stonedb::index::KVStore::<lambda()> &)(stonedb::index::KVStore::<lambda()> & __fn) (\opt\rh\devtoolset-7\root\usr\include\c++\7\bits\invoke.h:95)
std::thread::_Invoker<std::tuple<stonedb::index::KVStore::Init()::<lambda()> > >::_M_invoke<0>(std::_Index_tuple<0>)(std::thread::_Invoker<std::tuple<stonedb::index::KVStore::Init()::<lambda()> > > * const this) (\opt\rh\devtoolset-7\root\usr\include\c++\7\thread:234)
std::thread::_Invoker<std::tuple<stonedb::index::KVStore::Init()::<lambda()> > >::operator()(void)(std::thread::_Invoker<std::tuple<stonedb::index::KVStore::Init()::<lambda()> > > * const this) (\opt\rh\devtoolset-7\root\usr\include\c++\7\thread:243)
std::thread::_State_impl<std::thread::_Invoker<std::tuple<stonedb::index::KVStore::Init()::<lambda()> > > >::_M_run(void)(std::thread::_State_impl<std::thread::_Invoker<std::tuple<stonedb::index::KVStore::Init()::<lambda()> > > > * const this) (\opt\rh\devtoolset-7\root\usr\include\c++\7\thread:186)
execute_native_thread_routine (未知源:0)
libpthread.so.0!start_thread (未知源:0)
libc.so.6!clone (未知源:0)

@lylth
Copy link
Contributor

lylth commented Jul 24, 2022

Check that the data file is empty. Check the log and find that the table name has been escaped. $test1->@0024test1. Preliminary judgment that rocksdb does not support the '$' special character

@lylth lylth assigned lylth and unassigned DandreChen Jul 24, 2022
@mergify mergify bot closed this as completed in #427 Aug 24, 2022
mergify bot added a commit that referenced this issue Aug 24, 2022
…able name failure.(#222)(#362) (#427)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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 prio: high High priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants