Conversation
fc15dae to
4350de9
Compare
45997d2 to
319275e
Compare
| expected_date_time_sub, // expected_date_time_sub | ||
| 0, // expected_octet_char_length |
There was a problem hiding this comment.
For consistency and if this won't break the build, could we pass 0 directly for expected_date_time_sub here and remove expected_date_time_sub = 0?
I see value 0 is accepted for expected_octet_char_length, although expected_octet_char_length is type SQLINTEGER and expected_date_time_sub is SQLSMALLINT; their types are different.
| SQLWCHAR input_str[] = L"SELECT * FROM mytable WHERE id == 1"; | ||
| SQLINTEGER input_char_len = static_cast<SQLINTEGER>(wcslen(input_str)); | ||
| ASSIGN_SQLWCHAR_ARR(input_str, L"SELECT * FROM mytable WHERE id == 1"); | ||
| SQLINTEGER input_char_len = std::wcslen((const wchar_t*)input_str); |
There was a problem hiding this comment.
Let's use c++ style casting (I think it's const_cast<>?)
| // Create expected return string based on buf size | ||
| SQLWCHAR expected_string_buf[small_buf_size_in_char]; | ||
| wcsncpy(expected_string_buf, input_str, 10); | ||
| wcsncpy((wchar_t*)expected_string_buf, (wchar_t*)input_str, 10); |
There was a problem hiding this comment.
Could we use C++ style casing for (wchar_t*)? Same comment for other places
There was a problem hiding this comment.
Now using const_cast<wchar_t*>
There was a problem hiding this comment.
@justing-bq Could you push the changes for this?
|
|
||
| SQLSMALLINT expected_unsigned_attr = 0; | ||
| SQLSMALLINT expected_auto_unique_value = 0; | ||
| SQLSMALLINT expected_min_scale = 0; | ||
| SQLSMALLINT expected_max_scale = 0; | ||
| SQLSMALLINT expected_sql_datetime_sub = 0; | ||
| SQLSMALLINT expected_num_prec_radix = 0; | ||
| SQLSMALLINT expected_interval_prec = 0; | ||
| CheckSQLGetTypeInfo(stmt, | ||
| std::wstring(L"bit"), // expected_type_name | ||
| SQL_BIT, // expected_data_type | ||
| 1, // expected_column_size | ||
| std::nullopt, // expected_literal_prefix | ||
| std::nullopt, // expected_literal_suffix | ||
| std::nullopt, // expected_create_params | ||
| SQL_NULLABLE, // expected_nullable | ||
| SQL_FALSE, // expected_case_sensitive | ||
| SQL_SEARCHABLE, // expected_searchable | ||
| NULL, // expected_unsigned_attr | ||
| SQL_FALSE, // expected_fixed_prec_scale | ||
| NULL, // expected_auto_unique_value | ||
| std::wstring(L"bit"), // expected_local_type_name | ||
| NULL, // expected_min_scale | ||
| NULL, // expected_max_scale | ||
| SQL_BIT, // expected_sql_data_type | ||
| NULL, // expected_sql_datetime_sub | ||
| NULL, // expected_num_prec_radix | ||
| NULL); // expected_interval_prec | ||
| std::wstring(L"bit"), // expected_type_name |
There was a problem hiding this comment.
Similar comment as columns_test.cc, Let's pass 0 directly to CheckSQLGetTypeInfo. I think passing 0 instead of NULL here will work because NULL is not defined as 0 on Linux
| GetInfoSQLWCHAR(conn, SQL_COLUMN_ALIAS, value); | ||
|
|
||
| EXPECT_STREQ(static_cast<const SQLWCHAR*>(L"Y"), value); | ||
| std::wstring result = ConvertToWString(value, std::wcslen((const wchar_t*)value)); |
There was a problem hiding this comment.
Same comment here for using C++ style casting
8abdbf8 to
da7fb82
Compare
da7fb82 to
151cfa1
Compare
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?