3030 jack andrews 2009-09-23
Bug #47426: Parser.cpp won't parse "x=c:\windows"
. now finds first of ':' or '=' for the split
modified:
storage/ndb/src/common/util/CMakeLists.txt
storage/ndb/src/common/util/Parser.cpp
3029 jack andrews 2009-09-23
Bug #47428: ndbgeneral should target_link mysys, and ws2_32
modified:
storage/ndb/src/common/util/CMakeLists.txt
3028 Magnus Blåudd 2009-09-22
Bug#47526 unit.pl fails to execute binaries when using Test::Harness 3.10
- Rewrite unit.pl so it prefers to use TAP::Harness directly.
modified:
unittest/unit.pl
=== modified file 'storage/ndb/src/common/util/CMakeLists.txt'
--- a/storage/ndb/src/common/util/CMakeLists.txt 2009-06-02 14:00:06 +0000
+++ b/storage/ndb/src/common/util/CMakeLists.txt 2009-09-23 02:13:25 +0000
@@ -55,7 +55,7 @@ ADD_LIBRARY(ndbgeneral STATIC
Bitmask.cpp
ndbinfo.c
)
-TARGET_LINK_LIBRARIES(ndbgeneral zlib)
+TARGET_LINK_LIBRARIES(ndbgeneral zlib mysys ws2_32)
ADD_EXECUTABLE(BaseString-t BaseString.cpp)
SET_TARGET_PROPERTIES(BaseString-t
@@ -67,3 +67,7 @@ SET_TARGET_PROPERTIES(Bitmask-t
PROPERTIES COMPILE_FLAGS "-DTEST_BITMASK")
TARGET_LINK_LIBRARIES(Bitmask-t ndbgeneral)
+ADD_EXECUTABLE(Parser-t Parser.cpp)
+SET_TARGET_PROPERTIES(Parser-t
+ PROPERTIES COMPILE_FLAGS "-DTEST_PARSER")
+TARGET_LINK_LIBRARIES(Parser-t ndbgeneral)
=== modified file 'storage/ndb/src/common/util/Parser.cpp'
--- a/storage/ndb/src/common/util/Parser.cpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/common/util/Parser.cpp 2009-09-23 02:13:25 +0000
@@ -122,11 +122,12 @@ trim(char * str){
static
bool
split(char * buf, char ** name, char ** value){
-
- * value = strchr(buf, ':');
- if(* value == 0)
- * value = strchr(buf, '=');
+ for (*value=buf; **value; (*value)++) {
+ if (**value == ':' || **value == '=') {
+ break;
+ }
+ }
if(* value == 0){
return false;
@@ -357,3 +358,20 @@ ParserImpl::checkMandatory(Context* ctx,
}
template class Vector<const ParserRow<ParserImpl::Dummy>*>;
+
+#ifdef TEST_PARSER
+#include <NdbTap.hpp>
+
+TAPTEST(Parser)
+{
+ char *str, *name, *value;
+
+ //split modifies arg so dup
+ str = strdup("x=c:\\windows");
+ OK(split(str, &name, &value));
+ OK(!strcmp(name, "x"));
+ OK(!strcmp(value, "c:\\windows"));
+
+ return 1;
+}
+#endif
Attachment: [text/bzr-bundle] bzr/jack@sun.com-20090923021325-g0iixq1ssbl32my4.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (jack:3028 to 3030) Bug#47426 | jack andrews | 23 Sep |