Closed ccwxl closed 2 years ago
[ 97%] Building C object src/connector/odbc/examples/c/CMakeFiles/tcodbc.dir/main.c.o /Users/wxl/Desktop/TDengine/src/connector/odbc/examples/c/main.c:644:13: error: variable 'count' set but not used [-Werror,-Wunused-but-set-variable] size_t count = 0; ^ 1 error generated. make[2]: [src/connector/odbc/examples/c/CMakeFiles/tcodbc.dir/main.c.o] Error 1 make[1]: [src/connector/odbc/examples/c/CMakeFiles/tcodbc.dir/all] Error 2
same error.
什么分支?commit id 是多少?clang 是什么版本?最近刚修复了一个类似的问题,用最新 develop 分支应该没有这个问题了
public class TestTDengine { private static String host1 = "127.0.0.1"; private static String host = "192.168.8.80"; private static final String dbName = "iotdata"; private static final String user = "root"; private static final String password = "taosdata"; private Connection connection;
public static void main(String[] args) throws SQLException {
TestTDengine testTDengine = new TestTDengine();
testTDengine.init();
testTDengine.userdb();
testTDengine.testJni();
}
private void userdb() {
String sql = "use " + dbName;
exuete(sql);
}
private void testJni() throws SQLException {
String line = "dd_A001_1009,id=AA3043,protocol=A001 generateTs=1648757500175i,isstaticvoltage=1i,receiveTs=1648757500175i,voltage=26.3 1648757500175";
SchemalessWriter schemalessWriter = new SchemalessWriter(connection);
schemalessWriter.write(new String[]{line}, SchemalessProtocolType.LINE, SchemalessTimestampType.MILLI_SECONDS);
}
private void init() {
final String url = "jdbc:TAOS://" + host + ":6030/?user=" + user + "&password=" + password;
// get connection
try {
Properties properties = new Properties();
properties.setProperty("charset", "UTF-8");
properties.setProperty("locale", "en_US.UTF-8");
//非常重要
properties.setProperty("smlChildTableName", "id");
properties.setProperty("smlTagNullName", "protocol");
properties.setProperty("timezone", "UTC-8");
System.out.println("get connection starting...");
connection = DriverManager.getConnection(url, properties);
connection.setCatalog("iotdata");
if (connection != null) {
System.out.println("[ OK ] Connection established.");
}
} catch (SQLException e) {
e.printStackTrace();
}
}
private void exuete(String sql) {
long start = System.currentTimeMillis();
try (Statement statement = connection.createStatement()) {
boolean execute = statement.execute(sql);
long end = System.currentTimeMillis();
printSql(sql, true, (end - start));
} catch (SQLException e) {
long end = System.currentTimeMillis();
printSql(sql, false, (end - start));
e.printStackTrace();
}
}
private void printSql(String sql, boolean succeed, long cost) {
System.out.println("[ " + (succeed ? "OK" : "ERROR!") + " ] time cost: " + cost + " ms, execute statement ====> " + sql);
}
}
- 报错
Connected to the target VM, address: '127.0.0.1:54148', transport: 'socket' get connection starting... [ OK ] Connection established. [ OK ] time cost: 9 ms, execute statement ====> use iotdata Exception in thread "main" java.sql.SQLException: TDengine ERROR (2350): failed to insertLines at com.taosdata.jdbc.TSDBError.createSQLException(TSDBError.java:76) at com.taosdata.jdbc.TSDBJNIConnector.insertLines(TSDBJNIConnector.java:366) at com.taosdata.jdbc.SchemalessWriter.write(SchemalessWriter.java:35) at cn.nvriot.timeseries.tdengine.TestTDengine.testJni(TestTDengine.java:42) at cn.nvriot.timeseries.tdengine.TestTDengine.main(TestTDengine.java:31) Disconnected from the target VM, address: '127.0.0.1:54148', transport: 'socket'
- 服务端表自动建好了但数据没有写入进去.
dd_A001_1009 | 2022-04-06 13:07:55.172 | 5 | 3 | 1 | Query OK, 1 row(s) in set (0.001085s)
AA3043 | 2022-04-06 13:32:37.308 | 5 | dd_A001_1009 | 10696049144601636 | 1 | 38 | Query OK, 1 row(s) in set (0.006999s)
taos> select * from AA3043
;
Query OK, 0 row(s) in set (0.002180s)
- 写入到本地macos 的服务端是没有问题的.
mac 平台还没有正式支持,可能有没有发现的 bug
04/06 16:05:12.243204 00006049 TSC ERROR 0xaa64 async result callback, code:Invalid operation
04/06 16:05:12.243942 00006050 TSC ERROR 0xaa67 async result callback, code:Invalid operation
04/06 16:05:12.243974 00006024 TSC ERROR SML:0x15f7 taos_query return -2147483136:invalid operation: 'isstaticvoltage' (invalid column/tag name)
04/06 16:05:12.243989 00006024 TSC ERROR SML:0x15f7 Apply child table points failed. child table `AA3043`, error Invalid operation
04/06 16:05:12.243993 00006024 TSC ERROR SML:0x15f7 error apply data points : Invalid operation
04/06 16:05:12.243994 00006024 TSC ERROR SML:0x15f7 taos_sml_insert error: Invalid operation
04/06 16:05:12.244000 00006024 JNI ERROR jobj:0x7efb63efc0b0, conn:0x7efb643e75d0, code:Invalid operation, msg:Invalid operation
04/06 16:05:12.244709 00006052 TSC ERROR 0xaa6c async result callback, code:Invalid operation
04/06 16:05:12.245317 00006051 TSC ERROR 0xaa6f async result callback, code:Invalid operation
04/06 16:05:12.245338 00006024 TSC ERROR SML:0x15f8 taos_query return -2147483136:invalid operation: 'isstaticvoltage' (invalid column/tag name)
04/06 16:05:12.245352 00006024 TSC ERROR SML:0x15f8 Apply child table points failed. child table `AA3043`, error Invalid operation
04/06 16:05:12.245355 00006024 TSC ERROR SML:0x15f8 error apply data points : Invalid operation
04/06 16:05:12.245357 00006024 TSC ERROR SML:0x15f8 taos_sml_insert error: Invalid operation
04/06 16:05:12.245362 00006024 JNI ERROR jobj:0x7efb63efc0b0, conn:0x7efb643e75d0, code:Invalid operation, msg:Invalid operation
04/06 16:05:12.246136 00006049 TSC ERROR 0xaa74 async result callback, code:Invalid operation
04/06 16:05:12.246743 00006050 TSC ERROR 0xaa77 async result callback, code:Invalid operation
04/06 16:05:12.246771 00006024 TSC ERROR SML:0x15f9 taos_query return -2147483136:invalid operation: 'isstaticvoltage' (invalid column/tag name)
04/06 16:05:12.246786 00006024 TSC ERROR SML:0x15f9 Apply child table points failed. child table `AA3043`, error Invalid operation
04/06 16:05:12.246790 00006024 TSC ERROR SML:0x15f9 error apply data points : Invalid operation
04/06 16:05:12.246792 00006024 TSC ERROR SML:0x15f9 taos_sml_insert error: Invalid operation
04/06 16:05:12.246798 00006024 JNI ERROR jobj:0x7efb63efc0b0, conn:0x7efb643e75d0, code:Invalid operation, msg:Invalid operation
04/06 16:05:12.247559 00006052 TSC ERROR 0xaa7c async result callback, code:Invalid operation
04/06 16:05:12.248370 00006051 TSC ERROR 0xaa7f async result callback, code:Invalid operation
04/06 16:05:12.248392 00006024 TSC ERROR SML:0x15fa taos_query return -2147483136:invalid operation: 'isstaticvoltage' (invalid column/tag name)
04/06 16:05:12.248408 00006024 TSC ERROR SML:0x15fa Apply child table points failed. child table `AA3043`, error Invalid operation
04/06 16:05:12.248412 00006024 TSC ERROR SML:0x15fa error apply data points : Invalid operation
04/06 16:05:12.248414 00006024 TSC ERROR SML:0x15fa taos_sml_insert error: Invalid operation
04/06 16:05:12.248420 00006024 JNI ERROR jobj:0x7efb63efc0b0, conn:0x7efb643e75d0, code:Invalid operation, msg:Invalid operatio
dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828305000
dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828335000
dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828365000
2022-04-06 16:05:12.220 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.01 1648828065000]]
2022-04-06 16:05:12.222 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.01 1648828095000]]
2022-04-06 16:05:12.223 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.02 1648828125000]]
2022-04-06 16:05:12.224 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.01 1648828155000]]
2022-04-06 16:05:12.225 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.01 1648828185000]]
2022-04-06 16:05:12.227 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.01 1648828215000]]
2022-04-06 16:05:12.228 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828259339i,voltage=27.01 1648828245000]]
2022-04-06 16:05:12.229 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828275000]]
2022-04-06 16:05:12.231 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828305000]]
2022-04-06 16:05:12.232 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828335000]]
2022-04-06 16:05:12.233 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828365000]]
2022-04-06 16:05:12.235 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828395000]]
2022-04-06 16:05:12.236 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828425000]]
2022-04-06 16:05:12.237 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828481503i,voltage=27.01 1648828455000]]
2022-04-06 16:05:12.238 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828485000]]
2022-04-06 16:05:12.240 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828515000]]
2022-04-06 16:05:12.241 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828545000]]
2022-04-06 16:05:12.242 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828575000]]
2022-04-06 16:05:12.244 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828605000]]
2022-04-06 16:05:12.245 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828635000]]
2022-04-06 16:05:12.246 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=27.01 1648828665000]]
2022-04-06 16:05:12.248 -ERROR 5984 --- [KafkaConsumerDestination{consumerDestinationName='dev.device.timeseries.data.msg', partitions=5, dlqName='dev.device.timeseries.data.msg.dlq'}.container-2-C-1] c.n.t.tdengine.save.TDEngineSaveImpl [lineno:59]: [t
raceId:] tdengine writer data error: [TDengine ERROR (2350): failed to insertLines] dataline: [[dd_A001_1009,device=AA3043,protocol=A001 isstaticvoltage=1i,receiveTs=1648828703763i,voltage=26.98 1648828695000]]
→ sw_vers ProductName: macOS ProductVersion: 12.2.1 BuildVersion: 21D62
→ gcc --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/c++/4.2.1 Apple clang version 13.0.0 (clang-1300.0.27.3) Target: x86_64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
→ clang --version Apple clang version 13.0.0 (clang-1300.0.27.3) Target: x86_64-apple-darwin21.3.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
→ mkdir debug && cd debug cmake .. && cmake --build . -- The CXX compiler identification is AppleClang 13.0.0.13000027 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Community directory: /data/pro/tsdb/TDengine -- The C compiler identification is AppleClang 13.0.0.13000027 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- build with TSZ enabled -- The current platform is Darwin 64-bit -- The current platform x86_64 is detected -- The current platform is x86 -- Set CPUTYPE to x86 -- platform arch:i386 -- The user specified osType is unknown: Will not build taos_tools! Enable lua -- darwin64 is defined -- CMAKE_CXX_COMPILER_ID: Clang -- Project source directory: /data/pro/tsdb/TDengine -- Project binary files output path: /data/pro/tsdb/TDengine/debug -- Project executable files output path: /data/pro/tsdb/TDengine/debug/build/bin -- Project library files output path: /data/pro/tsdb/TDengine/debug/build/lib -- MVN is installed and JDBC will be compiled -- Build Debug Version as default -- git log result:c0ecbe2aded61e950e5ce84da8c0fc8158431d7e
-- git log result:c0ecbe2aded61e950e5ce84da8c0fc8158431d7e
-- ============= compile version parameter information start ============= -- ver number:2.4.0.0 -- compatible ver number:2.0.0.0 -- community commit id:c0ecbe2aded61e950e5ce84da8c0fc8158431d7e -- internal commit id:c0ecbe2aded61e950e5ce84da8c0fc8158431d7e -- build date:2022-04-17 22:49:25 -- ver type:stable -- ver cpu:x32 -- os type:Linux -- ============= compile version parameter information end ============= CMake Deprecation Warning at deps/TSZ/CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.
Update the VERSION argument
use original embedded httpd
-- Looking for SQLExecute -- Looking for SQLExecute - found -- unixodbc/unixodbc-dev are installed, and odbc connector will be built -- Found FLEX: /usr/bin/flex (found version "2.6.4") -- Configuring done -- Generating done -- Build files have been written to: /data/pro/tsdb/TDengine/debug [ 0%] Building C object deps/zlib-1.2.11/CMakeFiles/z.dir/src/adler32.c.o error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option] make[2]: [deps/zlib-1.2.11/CMakeFiles/z.dir/src/adler32.c.o] Error 1 make[1]: [deps/zlib-1.2.11/CMakeFiles/z.dir/all] Error 2 make: *** [all] Error 2
我是 macOS 12.3 clang 13.1.6,没问题。你可以修改一下 cmake/define.inc 文件
IF (CLANG_VERSION_STRING GREATER_EQUAL 13.0) SET(COMMON_FLAGS "${COMMON_FLAGS} -Wno-unused-but-set-variable") ENDIF ()
把 13.0 改为 13.1 试试
Bug Description [ 56%] Built target query [ 56%] Building C object src/client/CMakeFiles/taos_static.dir/src/TSDBJNIConnector.c.o [ 56%] Building C object src/client/CMakeFiles/taos_static.dir/src/dataxJniConnection.c.o [ 56%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscAsync.c.o [ 57%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscGlobalmerge.c.o [ 57%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscLocal.c.o [ 57%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscParseInsert.c.o [ 57%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscParseLineProtocol.c.o [ 58%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscParseOpenTSDB.c.o [ 58%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscPrepare.c.o [ 58%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscProfile.c.o [ 58%] Building C object src/client/CMakeFiles/taos_static.dir/src/tscSQLParser.c.o /Users/wxl/Desktop/TDengine/src/client/src/tscSQLParser.c:3015:17: error: variable 'numOfFields' set but not used [-Werror,-Wunused-but-set-variable] int32_t numOfFields = 0; ^ 1 error generated. make[2]: [src/client/CMakeFiles/taos_static.dir/src/tscSQLParser.c.o] Error 1 make[1]: [src/client/CMakeFiles/taos_static.dir/all] Error 2 make: *** [all] Error 2
编译时报错, 分支: ver-2.4.0.14