You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/12/13 06:19:10 UTC

[GitHub] [ignite-3] ptupitsyn commented on a diff in pull request #1440: IGNITE-17588 SQL API for C++ Client

ptupitsyn commented on code in PR #1440:
URL: https://github.com/apache/ignite-3/pull/1440#discussion_r1046699637


##########
modules/platforms/cpp/tests/client-test/sql_test.cpp:
##########
@@ -0,0 +1,235 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ignite_runner_suite.h"
+
+#include "ignite/client/ignite_client.h"
+#include "ignite/client/ignite_client_configuration.h"
+
+#include <gtest/gtest.h>
+
+#include <chrono>
+
+using namespace ignite;
+
+/**
+ * Test suite.
+ */
+class sql_test : public ignite_runner_suite {

Review Comment:
   Let's add more tests for various failure conditions, such as:
   * Invalid SQL text - does the user get a sensible error message?
   * What if I iterate the result set twice?
   * Can I access result set pages after closing the cursor?



##########
modules/platforms/cpp/ignite/protocol/utils.cpp:
##########
@@ -28,20 +28,73 @@
 
 namespace ignite::protocol {
 
+/**
+ * Check if int value fits in @c T.
+ *
+ * @tparam T Int type to fit value to.
+ * @param value Int value.
+ */
+template<typename T>
+inline void check_int_fits(std::int64_t value) {

Review Comment:
   This looks suspicious. I think we can use MsgPack type code prefixes to check if the next value in the stream is `int` or something else.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org