-
Notifications
You must be signed in to change notification settings - Fork 374
Revised a few existing tests that are flawed #1103
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
Conversation
return $success; | ||
} | ||
|
||
function isCompatible($dataType, $sqlType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same function as in the previous test? Can we put this in a common include file, maybe without $compatList as an argument?
// return SQLSTATE '42000' or '22018', the former indicating | ||
// an error when converting from one type to another and the | ||
// latter indicating an incompatible conversion error | ||
// Either one is acceptable for the purpose of this test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, why would we expect errors with compatible types?
createProc($conn, $spname, "@c_det $dataType OUTPUT, @c_rand $dataType OUTPUT", "SELECT @c_det = c_det, @c_rand = c_rand FROM $tbname"); | ||
|
||
// insert a row | ||
$inputValues = array_slice(${explode("(", $dataType)[0] . "_params"}, 1, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have an example here of what the input looks like? Expressions like this are tricky to parse by looking.
$r; | ||
$stmt = AE\insertRow($conn, $tbname, array( $colMetaArr[0]->colName => $inputValues[0], $colMetaArr[1]->colName => $inputValues[1] ), $r); | ||
if ($r === false) { | ||
is_incompatible_types_error($dataType, "default type"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_incompatible_types_error has the same issue you fixed elsewhere - it compares SQLSTATE to a non-string 22018.
// clash but only happens with some certain types) | ||
// E.g. when converting a bigint to int or an int to numeric, | ||
// SQLSTATE '42000' is returned, indicating an error when | ||
// converting from one type to another. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not clear on why we would get errors if the types are supposed to be compatible. Do the errors occur only in AE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only happens with non-AE, and there are many possible combinations -- will investigate further in another task
While converting tests from PR #720 discovered that the designs were flawed. These tests are rewritten and expanded to include non-AE testing as well.