Shannon-Data / ShannonBase

A MySQL HTAP Database, Open Source version of MySQL Heatwave, Powered by AI.
https://www.shannonbase.org
Other
16 stars 6 forks source link

[bug]: make build failed in Mac M1 #111

Closed hustjieke closed 8 months ago

hustjieke commented 8 months ago

build error msg:

/Users/gaoriyao/go/src/github.com/hustjieke/ShannonBase/storage/rapid_engine/handler/ha_shannon_rapid.cc:1033:8: error: cannot initialize a member subobject of type 'unsigned long *' with an rvalue of type 'uint64 *' (aka 'unsigned long long *')
static MYSQL_SYSVAR_ULONG(rapid_populate_buffer_size_max,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/gaoriyao/go/src/github.com/hustjieke/ShannonBase/include/mysql/plugin.h:391:7: note: expanded from macro 'MYSQL_SYSVAR_ULONG'
      &varname,                                                             \
      ^~~~~~~~
14 warnings and 1 error generated.
make[2]: *** [storage/rapid_engine/CMakeFiles/shannon_rapid.dir/handler/ha_shannon_rapid.cc.o] Error 1
make[1]: *** [storage/rapid_engine/CMakeFiles/shannon_rapid.dir/all] Error 2
make: *** [all] Error 2

env: Mac OS M1

code:

//static MYSQL_SYSVAR_ULONGLONG(rapid_populate_buffer_size_max,
static MYSQL_SYSVAR_ULONG(rapid_populate_buffer_size_max,
                          ShannonBase::Populate::population_buffer_size,
                          PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
                          "Number of populate buffer size that must not be 10% "
                          "rapid_populate_buffer size.",
                          NULL, nullptr,
                          ShannonBase::SHANNON_MAX_POPULATION_BUFFER_SIZE, 0,
                          ShannonBase::SHANNON_MAX_POPULATION_BUFFER_SIZE,0);

root cause: As SHANNON_MAX_POPULATION_BUFFER_SIZE defined type is uint64, but MYSQL_SYSVAR_ULONG is used, we should change it to MYSQL_SYSVAR_ULONGLONG

constexpr uint64 SHANNON_MAX_POPULATION_BUFFER_SIZE = 8 * SHANNON_MB;