Skip to content

Commit 0986c4c

Browse files
committed
Merge branch 'release/8.0.20'
# Conflicts: # packaging/CMakeLists.txt
2 parents 0be0cf3 + 7d0d901 commit 0986c4c

13 files changed

+813
-633
lines changed

CMakeLists.txt

Lines changed: 2 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ if(BUILD_STATIC)
198198
set_property(
199199
DIRECTORY .
200200
APPEND PROPERTY COMPILE_DEFINITIONS
201-
$<$<NOT:$<CONFIG:Static>>:CONCPP_BUILD_STATIC>
201+
CONCPP_BUILD_STATIC
202202
)
203203

204204
else()
@@ -221,7 +221,7 @@ else()
221221
set_property(
222222
DIRECTORY .
223223
APPEND PROPERTY COMPILE_DEFINITIONS
224-
$<$<NOT:$<CONFIG:Static>>:CONCPP_BUILD_SHARED>
224+
CONCPP_BUILD_SHARED
225225
)
226226
#add_compile_options($<$<NOT:$<CONFIG:Static>>:-DCONCPP_BUILD_SHARED>)
227227

@@ -231,23 +231,6 @@ else()
231231

232232
endif()
233233

234-
if(MAINTAINER_MODE)
235-
236-
list(APPEND CMAKE_CONFIGURATION_TYPES Static)
237-
238-
set(CMAKE_CXX_FLAGS_STATIC ${CMAKE_CXX_FLAGS_RELEASE})
239-
set(CMAKE_C_FLAGS_STATIC ${CMAKE_C_FLAGS_RELEASE})
240-
set(CMAKE_SHARED_LINKER_FLAGS_STATIC ${CMAKE_SHARED_LINKER_FLAGS_RELEASE})
241-
set(CMAKE_EXE_LINKER_FLAGS_STATIC ${CMAKE_EXE_LINKER_FLAGS_RELEASE})
242-
243-
set_property(
244-
DIRECTORY .
245-
APPEND PROPERTY COMPILE_DEFINITIONS
246-
$<$<CONFIG:Static>:CONCPP_BUILD_STATIC>
247-
)
248-
249-
endif()
250-
251234

252235
add_config_option(WITH_TESTS BOOL ADVANCED DEFAULT OFF
253236
"Build project's unit tests"
@@ -399,13 +382,6 @@ add_subdirectory(devapi)
399382
merge_libraries(connector xapi devapi)
400383
target_include_directories(connector PUBLIC "${PROJECT_SOURCE_DIR}/include")
401384

402-
if(MAINTAINER_MODE)
403-
404-
merge_libraries(connector-static STATIC xapi devapi)
405-
target_include_directories(connector-static PUBLIC "${PROJECT_SOURCE_DIR}/include")
406-
407-
endif()
408-
409385

410386
#
411387
# Embed rpath information in the connector library.
@@ -493,29 +469,6 @@ if(MSVC AND NOT BUILD_STATIC)
493469
endif()
494470

495471

496-
if(TARGET connector-static)
497-
498-
set_property(TARGET connector-static PROPERTY OUTPUT_NAME ${LIB_NAME_STATIC})
499-
500-
set_target_properties(connector-static PROPERTIES
501-
VERSION "${ABI_VERSION_MAJOR}.${CONCPP_VERSION}"
502-
SOVERSION "${ABI_VERSION_MAJOR}"
503-
)
504-
505-
install(TARGETS connector-static
506-
CONFIGURATIONS Static
507-
ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT XDevAPIDev
508-
RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll
509-
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll
510-
)
511-
512-
if(TARGET connector-jdbc-static)
513-
add_dependencies(connector-static connector-jdbc-static)
514-
endif()
515-
516-
endif()
517-
518-
519472
#
520473
# Tests
521474
# =====

common/result.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ convert(cdk::bytes data, Format_descr<cdk::TYPE_DOCUMENT>&)
155155
}
156156

157157

158+
Value
159+
mysqlx::impl::common::
160+
convert(cdk::foundation::bytes data, Format_descr<cdk::TYPE_DATETIME> &)
161+
{
162+
return{ data.begin(), data.size()};
163+
}
164+
165+
158166

159167
/*
160168
Result implementation

common/result.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,7 @@ Value convert(cdk::bytes, Format_descr<cdk::TYPE_STRING>&);
693693
Value convert(cdk::bytes, Format_descr<cdk::TYPE_INTEGER>&);
694694
Value convert(cdk::bytes, Format_descr<cdk::TYPE_FLOAT>&);
695695
Value convert(cdk::bytes, Format_descr<cdk::TYPE_DOCUMENT>&);
696+
Value convert(cdk::bytes, Format_descr<cdk::TYPE_DATETIME>&);
696697

697698
/*
698699
Generic template used when no type-specific specialization is defined.

devapi/tests/types-t.cc

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,8 @@ TEST_F(Types, datetime)
777777
" c0 DATE,"
778778
" c1 TIME,"
779779
" c2 DATETIME,"
780-
" c3 TIMESTAMP"
780+
" c3 TIMESTAMP,"
781+
" c4 DATETIME"
781782
")"
782783
);
783784

@@ -789,6 +790,7 @@ TEST_F(Types, datetime)
789790
data[1] = "10:40:23.456";
790791
data[2] = "2014-05-11 10:40";
791792
data[3] = "2014-05-11 11:35:00.000";
793+
data[4] = Value();
792794

793795
types.insert().values(data).execute();
794796

@@ -812,6 +814,10 @@ TEST_F(Types, datetime)
812814
cout << "column #3 type: " << c3.getType() << endl;
813815
EXPECT_EQ(Type::TIMESTAMP, c3.getType());
814816

817+
const Column &c4 = res.getColumn(4);
818+
cout << "column #4 type: " << c4.getType() << endl;
819+
EXPECT_EQ(Type::DATETIME, c4.getType());
820+
815821

816822
Row row = res.fetchOne();
817823

@@ -822,7 +828,25 @@ TEST_F(Types, datetime)
822828
for (unsigned j = 0; j < res.getColumnCount(); ++j)
823829
{
824830
cout << "- col#" << j << ": " << row[j] << endl;
831+
if(j==4)
832+
{
833+
EXPECT_TRUE(row[j].isNull());
834+
break;
835+
}
825836
EXPECT_EQ(Value::RAW, row[j].getType());
837+
switch(res.getColumn(j).getType())
838+
{
839+
case Type::DATE:
840+
case Type::TIME:
841+
EXPECT_EQ(4, row[j].getRawBytes().size());
842+
break;
843+
case Type::DATETIME:
844+
case Type::TIMESTAMP:
845+
EXPECT_EQ(6, row[j].getRawBytes().size());
846+
break;
847+
default:
848+
FAIL() << "Unexpected type! Update UT";
849+
}
826850
}
827851
}
828852

jdbc

Submodule jdbc updated 1 file

packaging/CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,30 @@
2727
# along with this program; if not, write to the Free Software Foundation, Inc.,
2828
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2929

30+
# ======================================================================
31+
# Install manifest
32+
# ======================================================================
33+
34+
# If requested, generate install manifest file which contains information
35+
# about install components and files in each component. INSTALL_MANIFEST
36+
# should be a path to the manifest file.
37+
# See the install_mainfest.cmake script in this directory.
38+
39+
if(DEFINED INSTALL_MANIFEST)
40+
41+
add_custom_target(generate_manifest
42+
ALL
43+
COMMAND ${CMAKE_COMMAND}
44+
-D MANIFEST_FILE=${INSTALL_MANIFEST}
45+
-D BUILD_DIR=${PROJECT_BINARY_DIR}
46+
-D CONFIG=$<CONFIG>
47+
-P "${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.cmake"
48+
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
49+
COMMENT "Generating install manifest"
50+
)
51+
52+
endif()
53+
3054

3155
# ======================================================================
3256
# Licenses for binary packages

0 commit comments

Comments
 (0)