Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into CBRD-25241
Browse files Browse the repository at this point in the history
  • Loading branch information
jongmin-won committed Apr 12, 2024
2 parents 2de54d1 + d226dfb commit 0098e21
Show file tree
Hide file tree
Showing 6 changed files with 238 additions and 27 deletions.
26 changes: 0 additions & 26 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ defaults: &defaults
working_directory: /home
docker:
- image: cubridci/cubridci:develop

oraclelinux: &oraclelinux
working_directory: /home
docker:
- image: cubridci/cubridci:ol7.8

test_defaults: &test_defaults
steps:
Expand Down Expand Up @@ -84,21 +79,6 @@ jobs:
parallelism: 8
<<: *test_defaults

test_medium_ol:
<<: *oraclelinux
environment:
TEST_SUITE: medium
resource_class: medium
<<: *test_defaults

test_sql_ol:
<<: *oraclelinux
environment:
TEST_SUITE: sql
resource_class: medium
parallelism: 8
<<: *test_defaults

build-windows:
machine:
image: 'windows-server-2019-vs2019:2022.08.1'
Expand Down Expand Up @@ -145,10 +125,4 @@ workflows:
requires:
- build

- test_medium_ol:
requires:
- build
- test_sql_ol:
requires:
- build
- build-windows
139 changes: 139 additions & 0 deletions src/compat/db_value_printer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,145 @@ void db_value_printer::describe_comment_value (const db_value *value)
m_buf += '\'';
}

//--------------------------------------------------------------------------------
void db_value_printer::describe_type (const db_value *value)
{
if (DB_IS_NULL (value))
{
m_buf ("NULL");
}
else
{
DB_TYPE type = DB_VALUE_TYPE (value);
switch (type)
{
case DB_TYPE_NULL:
m_buf ("NULL");
break;
case DB_TYPE_INTEGER:
m_buf ("INTEGER");
break;
case DB_TYPE_BIGINT:
m_buf ("BIGINT");
break;
case DB_TYPE_FLOAT:
m_buf ("FLOAT");
break;
case DB_TYPE_DOUBLE:
m_buf ("DOUBLE");
break;
case DB_TYPE_VARCHAR:
m_buf ("VARCHAR");
break;
case DB_TYPE_OBJECT:
m_buf ("OBJECT");
break;
case DB_TYPE_SET:
m_buf ("SET");
break;
case DB_TYPE_MULTISET:
m_buf ("MULTISET");
break;
case DB_TYPE_SEQUENCE:
m_buf ("SEQUENCE");
break;
case DB_TYPE_BLOB:
m_buf ("BLOB");
break;
case DB_TYPE_CLOB:
m_buf ("CLOB");
break;
case DB_TYPE_TIME:
m_buf ("TIME");
break;
case DB_TYPE_TIMESTAMP:
m_buf ("TIMESTAMP");
break;
case DB_TYPE_TIMESTAMPTZ:
m_buf ("TIMESTAMPTZ");
break;
case DB_TYPE_TIMESTAMPLTZ:
m_buf ("TIMESTAMPLTZ");
break;
case DB_TYPE_DATETIME:
m_buf ("DATETIME");
break;
case DB_TYPE_DATETIMETZ:
m_buf ("DATETIMETZ");
break;
case DB_TYPE_DATETIMELTZ:
m_buf ("DATETIMELTZ");
break;
case DB_TYPE_DATE:
m_buf ("DATE");
break;
case DB_TYPE_MONETARY:
m_buf ("MONETARY");
break;
case DB_TYPE_VARIABLE:
m_buf ("VARIABLE");
break;
case DB_TYPE_SUB:
m_buf ("SUB");
break;
case DB_TYPE_POINTER:
m_buf ("POINTER");
break;
case DB_TYPE_ERROR:
m_buf ("ERROR");
break;
case DB_TYPE_SMALLINT:
m_buf ("SMALLINT");
break;
case DB_TYPE_VOBJ:
m_buf ("VOBJ");
break;
case DB_TYPE_OID:
m_buf ("OID");
break;
case DB_TYPE_NUMERIC:
m_buf ("NUMERIC");
break;
case DB_TYPE_BIT:
m_buf ("BIT");
break;
case DB_TYPE_VARBIT:
m_buf ("VARBIT");
break;
case DB_TYPE_CHAR:
m_buf ("CHAR");
break;
case DB_TYPE_NCHAR:
m_buf ("NCHAR");
break;
case DB_TYPE_VARNCHAR:
m_buf ("VARNCHAR");
break;
case DB_TYPE_DB_VALUE:
m_buf ("DB_VALUE");
break;
case DB_TYPE_RESULTSET:
m_buf ("DB_RESULTSET");
break;
case DB_TYPE_MIDXKEY:
m_buf ("DB_MIDXKEY");
break;
case DB_TYPE_TABLE:
m_buf ("DB_TABLE");
break;
case DB_TYPE_ENUMERATION:
m_buf ("ENUM");
break;
case DB_TYPE_JSON:
m_buf ("JSON");
break;
default:
m_buf ("UNKNOWN");
break;
}
}
}

//--------------------------------------------------------------------------------
void db_value_printer::describe_value (const db_value *value)
{
Expand Down
1 change: 1 addition & 0 deletions src/compat/db_value_printer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class db_value_printer
, m_padding (padding)
{}

void describe_type (const db_value *value);
void describe_money (const db_monetary *value); //former describe_money(parser...)
void describe_value (const db_value *value); //former describe_value(parser...)
void describe_data (const db_value *value); //former describe_data(parser...)
Expand Down
11 changes: 10 additions & 1 deletion src/executables/unload_schema.c
Original file line number Diff line number Diff line change
Expand Up @@ -3295,9 +3295,17 @@ emit_reverse_unique_def (extract_context & ctxt, print_output & output_ctx, DB_O

// reverse unique does not care for direction of the column.
}
output_ctx (");\n");

output_ctx (")");

if (constraint->comment != NULL && constraint->comment[0] != '\0')
{
output_ctx (" ");
help_print_describe_comment (output_ctx, constraint->comment);
}
}
}
output_ctx (";\n");
}


Expand Down Expand Up @@ -5572,6 +5580,7 @@ emit_unique_key (extract_context & ctxt, print_output & output_ctx, DB_OBJLIST *

if (reverse_unique_flag)
{
output_ctx ("\n");
emit_reverse_unique_def (ctxt, output_ctx, cl->op);
}

Expand Down
86 changes: 86 additions & 0 deletions src/method/method_invoke_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "boot_sr.h"
#include "dbtype.h" /* db_value_* */
#include "db_value_printer.hpp"
#include "jsp_comm.h" /* common communcation functions for javasp */
#include "mem_block.hpp" /* cubmem::extensible_block */
#include "method_invoke.hpp"
Expand All @@ -30,6 +31,7 @@
#include "method_connection_sr.hpp"
#include "method_connection_pool.hpp"
#include "session.h"
#include "string_buffer.hpp"

#if defined (SA_MODE)
#include "query_method.hpp"
Expand Down Expand Up @@ -173,6 +175,72 @@ namespace cubmethod
m_parameter_info = param_info;
}

bool
method_invoke_group::is_supported_dbtype (const DB_VALUE &value)
{
bool res = false;
switch (DB_VALUE_TYPE (&value))
{
case DB_TYPE_INTEGER:
case DB_TYPE_SHORT:
case DB_TYPE_BIGINT:
case DB_TYPE_FLOAT:
case DB_TYPE_DOUBLE:
case DB_TYPE_MONETARY:
case DB_TYPE_NUMERIC:
case DB_TYPE_CHAR:
case DB_TYPE_NCHAR:
case DB_TYPE_VARNCHAR:
case DB_TYPE_STRING:

case DB_TYPE_DATE:
case DB_TYPE_TIME:
case DB_TYPE_TIMESTAMP:
case DB_TYPE_DATETIME:

case DB_TYPE_SET:
case DB_TYPE_MULTISET:
case DB_TYPE_SEQUENCE:
case DB_TYPE_OID:
case DB_TYPE_OBJECT:

case DB_TYPE_RESULTSET:
case DB_TYPE_NULL:
res = true;
break;

// unsupported types
case DB_TYPE_BIT:
case DB_TYPE_VARBIT:
case DB_TYPE_TABLE:
case DB_TYPE_BLOB:
case DB_TYPE_CLOB:
case DB_TYPE_TIMESTAMPTZ:
case DB_TYPE_TIMESTAMPLTZ:
case DB_TYPE_DATETIMETZ:
case DB_TYPE_DATETIMELTZ:
case DB_TYPE_JSON:
res = false;
break;

// obsolete, internal, unused type
case DB_TYPE_ELO:
case DB_TYPE_VARIABLE:
case DB_TYPE_SUB:
case DB_TYPE_POINTER:
case DB_TYPE_ERROR:
case DB_TYPE_VOBJ:
case DB_TYPE_DB_VALUE:
case DB_TYPE_MIDXKEY:
case DB_TYPE_ENUMERATION:
default:
assert (false);
break;
}

return res;
}

int
method_invoke_group::prepare (std::vector<std::reference_wrapper<DB_VALUE>> &arg_base,
const std::vector<bool> &arg_use_vec)
Expand All @@ -194,6 +262,24 @@ namespace cubmethod
}
case METHOD_TYPE_JAVA_SP:
{
/* check arg_base's type is supported */
for (const DB_VALUE &value : arg_base)
{
if (is_supported_dbtype (value) == false)
{
error = ER_SP_EXECUTE_ERROR;
std::string err_msg = "unsupported argument type - ";

string_buffer sb;
db_value_printer printer (sb);
printer.describe_type (&value);

err_msg += std::string (sb.get_buffer(), sb.len ());
set_error_msg (err_msg);
return error;
}
}

/* optimize arguments only for java sp not to send redundant values */
DB_VALUE null_val;
db_make_null (&null_val);
Expand Down
2 changes: 2 additions & 0 deletions src/method/method_invoke_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ namespace cubmethod
private:
void destory_all_cursors ();

bool is_supported_dbtype (const DB_VALUE &value);

runtime_context *m_rctx;
bool m_is_running;
bool m_is_for_scan;
Expand Down

0 comments on commit 0098e21

Please sign in to comment.