Skip to content

Commit

Permalink
Create que_types library
Browse files Browse the repository at this point in the history
  • Loading branch information
romz-pl committed Sep 6, 2019
1 parent 21872f5 commit efd02dc
Show file tree
Hide file tree
Showing 13 changed files with 98 additions and 19 deletions.
Binary file modified library-dependency/innobase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 3 additions & 19 deletions storage/innobase/include/que0types.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,18 @@ this program; if not, write to the Free Software Foundation, Inc.,

#include <innodb/univ/univ.h>

#include <innodb/data_types/dfield_t.h>


#include "btr0types.h"


/* Pseudotype for all graph nodes */
typedef void que_node_t;
#include <innodb/que_types/que_common_t.h>

/* Query graph root is a fork node */
typedef struct que_fork_t que_t;

struct que_thr_t;

/* Common struct at the beginning of each query graph node; the name of this
substruct must be 'common' */

struct que_common_t {
ulint type; /*!< query node type */
que_node_t *parent; /*!< back pointer to parent node, or NULL */
que_node_t *brother; /* pointer to a possible brother node */
dfield_t val; /*!< evaluated value for an expression */
ulint val_buf_size;
/* buffer size for the evaluated value data,
if the buffer has been allocated dynamically:
if this field is != 0, and the node is a
symbol node or a function node, then we
have to free the data field in val
explicitly */
};


#endif
2 changes: 2 additions & 0 deletions storage/innobase/libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ add_subdirectory( memory_check )
add_subdirectory( monitor )
add_subdirectory( mtr )

add_subdirectory( que_types )

add_subdirectory( page )
add_subdirectory( pfs )
add_subdirectory( print )
Expand Down
3 changes: 3 additions & 0 deletions storage/innobase/libs/que_types/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_subdirectory( src )
add_subdirectory( tests )

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include <innodb/univ/univ.h>

#include <innodb/data_types/dfield_t.h>
#include <innodb/que_types/que_node_t.h>

/* Common struct at the beginning of each query graph node; the name of this
substruct must be 'common' */
struct que_common_t {
ulint type; /*!< query node type */
que_node_t *parent; /*!< back pointer to parent node, or NULL */
que_node_t *brother; /* pointer to a possible brother node */
dfield_t val; /*!< evaluated value for an expression */
ulint val_buf_size;
/* buffer size for the evaluated value data,
if the buffer has been allocated dynamically:
if this field is != 0, and the node is a
symbol node or a function node, then we
have to free the data field in val
explicitly */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#include <innodb/univ/univ.h>

/* Pseudotype for all graph nodes */
typedef void que_node_t;
22 changes: 22 additions & 0 deletions storage/innobase/libs/que_types/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
set( LIB_NAME que_types )

add_library( ${LIB_NAME} STATIC
que_common_t.cpp
que_node_t.cpp
)

target_compile_options( ${LIB_NAME} PRIVATE )

target_include_directories(
${LIB_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../include
)

target_link_libraries(
${LIB_NAME}
PUBLIC
data_types
PRIVATE
)

1 change: 1 addition & 0 deletions storage/innobase/libs/que_types/src/que_common_t.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <innodb/que_types/que_common_t.h>
1 change: 1 addition & 0 deletions storage/innobase/libs/que_types/src/que_node_t.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include <innodb/que_types/que_node_t.h>
16 changes: 16 additions & 0 deletions storage/innobase/libs/que_types/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set( TEST_NAME que_types-utests )

add_executable( ${TEST_NAME}
base.cpp
main.cpp
)

add_test( NAME ${TEST_NAME} COMMAND ${TEST_NAME} )

target_compile_options( ${TEST_NAME} PRIVATE )

target_include_directories( ${TEST_NAME} PRIVATE )

target_link_libraries( ${TEST_NAME} PRIVATE gtest que_types )


12 changes: 12 additions & 0 deletions storage/innobase/libs/que_types/tests/base.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <gtest/gtest.h>
// #include <innodb/que_types/que_types.h>


//
//
TEST( que_types, constructor )
{

}


9 changes: 9 additions & 0 deletions storage/innobase/libs/que_types/tests/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <gtest/gtest.h>

int main( int argc, char **argv )
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}


1 change: 1 addition & 0 deletions storage/innobase/libs/trx_trx/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ target_link_libraries(
io
lock_types
log_sn
que_types
read
string
trx_sys
Expand Down

0 comments on commit efd02dc

Please sign in to comment.