From a11edae6013920b0b28dcca131e984a36791f98f Mon Sep 17 00:00:00 2001 From: drrtuy Date: Mon, 21 Jul 2025 12:33:19 +0000 Subject: [PATCH] chore(): removed test rgprint binary --- debian/mariadb-plugin-columnstore.install | 1 - tools/CMakeLists.txt | 1 - tools/rgprint/CMakeLists.txt | 9 --- tools/rgprint/rgprint.cpp | 95 ----------------------- 4 files changed, 106 deletions(-) delete mode 100644 tools/rgprint/CMakeLists.txt delete mode 100644 tools/rgprint/rgprint.cpp diff --git a/debian/mariadb-plugin-columnstore.install b/debian/mariadb-plugin-columnstore.install index 89f78a604..0efba1cf8 100644 --- a/debian/mariadb-plugin-columnstore.install +++ b/debian/mariadb-plugin-columnstore.install @@ -45,7 +45,6 @@ usr/bin/mycnfUpgrade usr/bin/post-mysql-install usr/bin/post-mysqld-install usr/bin/reset_locks -usr/bin/rgprint usr/bin/rollback usr/bin/save_brm usr/bin/smcat diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index a0d6971c2..cb4002ecb 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -10,6 +10,5 @@ add_subdirectory(getConfig) add_subdirectory(idbmeminfo) add_subdirectory(passwd) add_subdirectory(rebuildEM) -add_subdirectory(rgprint) add_subdirectory(setConfig) add_subdirectory(viewtablelock) diff --git a/tools/rgprint/CMakeLists.txt b/tools/rgprint/CMakeLists.txt deleted file mode 100644 index 699cef3e9..000000000 --- a/tools/rgprint/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -include_directories(${ENGINE_COMMON_INCLUDES}) - -# ########## next target ############### - -set(rgprint_SRCS rgprint.cpp) - -columnstore_executable(rgprint ${rgprint_SRCS}) - -columnstore_link(rgprint ${ENGINE_LDFLAGS} ${ENGINE_WRITE_LIBS}) diff --git a/tools/rgprint/rgprint.cpp b/tools/rgprint/rgprint.cpp deleted file mode 100644 index 49b91f59a..000000000 --- a/tools/rgprint/rgprint.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* Copyright (C) 2021 MariaDB Corporation - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; version 2 of - the License. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ - -#include -#include -#include -#include -#include -#include - -int main(int argc, char* argv[]) -{ - if (argc < 2) - { - std::cerr << "Usage: " << argv[0] << " " << std::endl; - return 0; - } - rowgroup::RowGroup rg; - char* p = strrchr(argv[1], '/'); - int rfd = -1; - if (p == nullptr) - p = argv[1]; - unsigned pid; - void* agg; - auto c = sscanf(p, "Agg-p%u-t%p-", &pid, &agg); - if (c == 2) - { - char fname[1024]; - snprintf(fname, sizeof(fname), "META-p%u-t%p", pid, agg); - rfd = open(fname, O_RDONLY); - } - if (rfd < 0) - rfd = open("./META", O_RDONLY); - if (rfd >= 0) - { - struct stat rst; - fstat(rfd, &rst); - messageqcpp::ByteStream rbs; - rbs.needAtLeast(rst.st_size); - rbs.restart(); - auto r = read(rfd, rbs.getInputPtr(), rst.st_size); - if (r != rst.st_size) - abort(); - rbs.advanceInputPtr(r); - rg.deserialize(rbs); - close(rfd); - } - else - { - std::vector pos{2, 6, 22, 30, 46, 54}; // ? - std::vector oids{3011, 3011, 3011, 3011, 3011}; // ? - std::vector keys{1, 1, 1, 1, 1}; // ? - std::vector col_t{ - execplan::CalpontSystemCatalog::INT, execplan::CalpontSystemCatalog::LONGDOUBLE, - execplan::CalpontSystemCatalog::UBIGINT, execplan::CalpontSystemCatalog::LONGDOUBLE, - execplan::CalpontSystemCatalog::UBIGINT}; - std::vector csN{8, 8, 8, 8, 8}; - std::vector scale{0, 0, 0, 0, 0}; - std::vector prec{10, 4294967295, 9999, 4294967295, 19}; - rg = rowgroup::RowGroup(5, pos, oids, keys, col_t, csN, scale, prec, 20, false, std::vector{}); - } - - int fd = open(argv[1], O_RDONLY); - struct stat st; - fstat(fd, &st); - - messageqcpp::ByteStream bs; - bs.needAtLeast(st.st_size); - bs.restart(); - auto r = read(fd, bs.getInputPtr(), st.st_size); - if (r != st.st_size) - abort(); - bs.advanceInputPtr(r); - rowgroup::RGData rst; - rst.deserialize(bs); - - rg.setData(&rst); - close(fd); - std::cout << "RowGroup data:\n" << rg.toString() << std::endl; - return 0; -} \ No newline at end of file