Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s390x support: changes to fix test failures #43

Merged
merged 3 commits into from Jun 5, 2021

Conversation

Nayana-ibm
Copy link
Contributor

@Nayana-ibm Nayana-ibm commented Apr 6, 2021

Code changes required to fix the below test failures on s390x
1 - odbc_basic
20 - odbc_error
21 - odbc_param

Please review.

@lawrinn
Copy link
Collaborator

lawrinn commented Apr 24, 2021

Thank you for your contribution

Similar to other open source projects, the MariaDB Corporation needs to have shared ownership of all code that is included in the MariaDB C/ODBC distribution. The easiest way to achieve this is by submitting your code under the BSD-new license.

Please indicate in a comment below that you are contributing your new code of the whole pull request, including one or several files that are either new files or modified ones, under the BSD-new license.

We cannot test on s390, this platform is not officially supported by us, thus we cannot guarantee, that your change won't be broken by some newer changes. Since your changes are in tests only, I can imagine that wouldn't be a great concern for you.

If you are fine with all that, than I'll take another look, maybe couple of changes would be needed.

@Nayana-ibm
Copy link
Contributor Author

I am contributing my new code of the whole pull request, including one or several files that are either new files or modified ones, under the BSD-new license.

@Nayana-ibm
Copy link
Contributor Author

Nayana-ibm commented Apr 30, 2021

@lawrinn Please review changes and let me know in case of any modifications

@lawrinn lawrinn force-pushed the master branch 3 times, most recently from c65037c to fe23856 Compare May 3, 2021 20:55
@@ -586,7 +586,11 @@ SQLRETURN MADB_DbcConnectDB(MADB_Dbc *Connection,
MADB_Dsn *Dsn)
{
char StmtStr[128];
#if defined(__s390x__)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be just changed to my_bool without if defined. Or just initialized with someting like 0x01010101

@@ -70,8 +70,11 @@ ODBC_TEST(test_CONO3)
ODBC_TEST(simple_test)
{
SQLRETURN rc= SQL_SUCCESS;

#if defined(__s390x__)
SQLSMALLINT value=3;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same - just can be changed to SQLSMALLINT

@@ -1528,7 +1531,12 @@ ODBC_TEST(odbc45)
for (i= 0; i<sizeof(XpctdValue); ++i)
{
CHECK_STMT_RC(Stmt, SQLFetch(Stmt));
#if defined(__s390x__)
SQLGetData(Stmt, 1, SQL_C_BIT, &value, sizeof(value), 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look, that for test it's important to fetch values as ints, thus it can be just changed to fetch values as SQL_C_BIT

#if defined(__s390x__)
SQLGetData(Stmt, 1, SQL_C_BIT, &value, sizeof(value), 0);
is_num(value, XpctdValue[i]);
#else
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also suspect, that explicit casting of XpctdValue[i] to int could fix the test for s390. Not sure, though

@lawrinn lawrinn merged commit ca5d92c into mariadb-corporation:master Jun 5, 2021
@lawrinn
Copy link
Collaborator

lawrinn commented Jun 5, 2021

I've merged the PR as is, but I'm gonna make the behavior you added #if defined(s390x) a default behavior for all platforms. Just like I said in my comments

@Nayana-ibm
Copy link
Contributor Author

I've merged the PR as is, but I'm gonna make the behavior you added #if defined(s390x) a default behavior for all platforms. Just like I said in my comments

Thanks for merging the PR. You will be raising another PR to make a default behavior?

@lawrinn
Copy link
Collaborator

lawrinn commented Jun 7, 2021

I've done that already. I have a question, though. Or a request even. I have two open JIRA tickets re s390 - https://jira.mariadb.org/browse/ODBC-130 and https://jira.mariadb.org/browse/ODBC-128 Do you happen to know, if they can be closed?

@Nayana-ibm
Copy link
Contributor Author

@lawrinn Yes. These JIRA tickets can be closed as we do not see this failure now.

@Nayana-ibm
Copy link
Contributor Author

@lawrinn I have also created a PR for adding s390x to travis through #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants