Merge branch '2.0' into 2.1

This commit is contained in:
Markus Mäkelä
2017-03-09 10:01:38 +02:00
5 changed files with 25 additions and 2 deletions

View File

@ -121,6 +121,13 @@ if(${MAXSCALE_VERSION} MATCHES "-stable")
endif() endif()
endif() endif()
# Copy cmake_flags, JENKINS_BUILD_TAG, source and value evironmental variables
# into cmake variables. These are used by the build system to store information
# about the packages being built.
set(MAXSCALE_SOURCE "$ENV{source} $ENV{value}")
set(MAXSCALE_CMAKE_FLAGS "$ENV{cmake_flags}")
set(MAXSCALE_JENKINS_BUILD_TAG "$ENV{BUILD_TAG}")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/server/include) file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/server/include)
configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/version.h.in ${CMAKE_BINARY_DIR}/include/maxscale/version.h @ONLY) configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/version.h.in ${CMAKE_BINARY_DIR}/include/maxscale/version.h @ONLY)
configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/paths.h.in ${CMAKE_BINARY_DIR}/include/maxscale/paths.h @ONLY) configure_file(${CMAKE_SOURCE_DIR}/include/maxscale/paths.h.in ${CMAKE_BINARY_DIR}/include/maxscale/paths.h @ONLY)

View File

@ -1,2 +1,5 @@
#define MAXSCALE_VERSION "@MAXSCALE_VERSION@" #define MAXSCALE_VERSION "@MAXSCALE_VERSION@"
#define MAXSCALE_COMMIT "@MAXSCALE_COMMIT@" #define MAXSCALE_COMMIT "@MAXSCALE_COMMIT@"
#define MAXSCALE_SOURCE "@MAXSCALE_SOURCE@"
#define MAXSCALE_CMAKE_FLAGS "@MAXSCALE_CMAKE_FLAGS@"
#define MAXSCALE_JENKINS_BUILD_TAG "@MAXSCALE_JENKINS_BUILD_TAG@"

View File

@ -1375,6 +1375,18 @@ int main(int argc, char **argv)
case 'V': case 'V':
rc = EXIT_SUCCESS; rc = EXIT_SUCCESS;
printf("MaxScale %s - %s\n", MAXSCALE_VERSION, maxscale_commit); printf("MaxScale %s - %s\n", MAXSCALE_VERSION, maxscale_commit);
if (strcmp(MAXSCALE_SOURCE, " ") != 0)
{
printf("Source: %s\n", MAXSCALE_SOURCE);
}
if (strcmp(MAXSCALE_CMAKE_FLAGS, "") != 0)
{
printf("CMake flags: %s\n", MAXSCALE_CMAKE_FLAGS);
}
if (strcmp(MAXSCALE_JENKINS_BUILD_TAG, "") != 0)
{
printf("Jenkins build: %s\n", MAXSCALE_JENKINS_BUILD_TAG);
}
goto return_main; goto return_main;
case 'l': case 'l':

View File

@ -123,7 +123,7 @@ AVRO_TABLE* avro_table_alloc(const char* filepath, const char* json_schema, size
if (access(filepath, F_OK) == 0) if (access(filepath, F_OK) == 0)
{ {
rc = avro_file_writer_open(filepath, &table->avro_file); rc = avro_file_writer_open_bs(filepath, &table->avro_file, block_size);
} }
else else
{ {

View File

@ -594,7 +594,8 @@ bool rwsplit_get_dcb(DCB **p_dcb, ROUTER_CLIENT_SES *rses, backend_type_t btype,
* backend and update assign it to new candidate if * backend and update assign it to new candidate if
* necessary. * necessary.
*/ */
else if (SERVER_IS_SLAVE(&server)) else if (SERVER_IS_SLAVE(&server) ||
(rses->rses_config.master_accept_reads && SERVER_IS_MASTER(&server)))
{ {
if (max_rlag == MAX_RLAG_UNDEFINED || if (max_rlag == MAX_RLAG_UNDEFINED ||
(b->server->rlag != MAX_RLAG_NOT_AVAILABLE && (b->server->rlag != MAX_RLAG_NOT_AVAILABLE &&