You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
@ -32,6 +32,7 @@ ADD_LIBRARY(ddlpackage SHARED
|
||||
markpartition.cpp
|
||||
restorepartition.cpp
|
||||
droppartition.cpp
|
||||
debugstatement.cpp
|
||||
${BISON_ddl_gram_OUTPUTS}
|
||||
${FLEX_ddl_scan_OUTPUTS}
|
||||
)
|
||||
|
@ -332,7 +332,8 @@ enum DDL_SERIAL_TYPE
|
||||
DDL_TRUNC_TABLE_STATEMENT,
|
||||
DDL_MARK_PARTITION_STATEMENT,
|
||||
DDL_RESTORE_PARTITION_STATEMENT,
|
||||
DDL_DROP_PARTITION_STATEMENT
|
||||
DDL_DROP_PARTITION_STATEMENT,
|
||||
DDL_DEBUG_STATEMENT
|
||||
};
|
||||
|
||||
/** @brief An abstract base for TableDef, ColumnDef, ...
|
||||
@ -1319,8 +1320,10 @@ struct AlterTableStatement : public SqlStatement
|
||||
|
||||
QualifiedName* fTableName;
|
||||
AlterTableActionList fActions;
|
||||
|
||||
private:
|
||||
long fTimeZone;
|
||||
|
||||
public:
|
||||
};
|
||||
|
||||
@ -1441,6 +1444,30 @@ struct DropTableStatement : public SqlStatement
|
||||
bool fCascade;
|
||||
};
|
||||
|
||||
/** @brief DebugStatement
|
||||
*/
|
||||
struct DebugDDLStatement : public SqlStatement
|
||||
{
|
||||
/** @brief Deserialize from ByteStream */
|
||||
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs);
|
||||
|
||||
/** @brief Serialize to ByteStream */
|
||||
EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
|
||||
|
||||
DebugDDLStatement(uint32_t debugLevel);
|
||||
|
||||
EXPORT DebugDDLStatement();
|
||||
|
||||
/** @brief Dump to stdout. */
|
||||
EXPORT std::ostream& put(std::ostream& os) const;
|
||||
|
||||
virtual ~DebugDDLStatement()
|
||||
{
|
||||
}
|
||||
|
||||
uint32_t fDebugLevel;
|
||||
};
|
||||
|
||||
/** @brief TruncTableStatement represents the drop table operation
|
||||
*/
|
||||
struct TruncTableStatement : public SqlStatement
|
||||
|
40
dbcon/ddlpackage/debugstatement.cpp
Normal file
40
dbcon/ddlpackage/debugstatement.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
/* Copyright (C) 2024 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. */
|
||||
|
||||
#define DDLPKG_DLLEXPORT
|
||||
#include "ddlpkg.h"
|
||||
#undef DDLPKG_DLLEXPORT
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace ddlpackage
|
||||
{
|
||||
DebugDDLStatement::DebugDDLStatement(uint32_t debugLevel)
|
||||
: fDebugLevel(debugLevel)
|
||||
{
|
||||
}
|
||||
|
||||
DebugDDLStatement::DebugDDLStatement()
|
||||
: fDebugLevel(0)
|
||||
{
|
||||
}
|
||||
|
||||
ostream& DebugDDLStatement::put(ostream& os) const
|
||||
{
|
||||
os << "DDL debug level: " << fDebugLevel << endl;
|
||||
return os;
|
||||
}
|
||||
} // namespace ddlpackage
|
@ -429,6 +429,21 @@ int DropTableStatement::serialize(ByteStream& bytestream)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** @brief Construct from Bytestream */
|
||||
int DebugDDLStatement::unserialize(ByteStream& bytestream)
|
||||
{
|
||||
bytestream >> fDebugLevel;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** @brief Serialize to ByteStream */
|
||||
int DebugDDLStatement::serialize(ByteStream& bytestream)
|
||||
{
|
||||
bytestream << (quadbyte)DDL_DEBUG_STATEMENT;
|
||||
bytestream << fDebugLevel;
|
||||
return 1;
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
/// TruncTableStatement Serialization
|
||||
///////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user