-
Notifications
You must be signed in to change notification settings - Fork 143
feat: support other databases #402
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
feat: support other databases #402
Conversation
| $this->disableDBDebug(); | ||
|
|
||
| if ($this->db->getPlatform() === 'OCI8' && $identifier === '') { | ||
| $identifier = ' '; |
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.
... and this?
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.
Ah I see the whole commit message now, that explains this one. Seems like this is probably a bug in the framework driver itself, right?
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 not sure.
Oracle sees '' as NULL.
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.
Oracle Database currently treats a character value with a length of zero as null. However, this may not continue to be true in future releases, and Oracle recommends that you do not treat empty strings the same as nulls.
More see.
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.
@datamweb I knew it, but I don't know what should we do in this case.
We try to insert '', but Oracle treats it as NULL and says "cannot insert NULL"
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.
@kenjis I'm not sure if it's helpful, but take a look if you have time.
https://stackoverflow.com/questions/2185743/is-it-possible-to-store-empty-string-as-a-non-null-value-in-the-database/73396113#73396113
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.
Use an alternate representation, such as a single space character, for an empty string.
It is what I did here.
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.
@ytetsuro have any recommendations? Or @sclubricants?
Query error: 1400, ORA-01400: cannot insert NULL into ("ORACLE"."db_auth_logins"."identifier"), query: INSERT INTO "db_auth_logins" ("ip_address", "user_agent", "id_type", "identifier", "user_id", "date", "success") VALUES ('0.0.0.0', '', 'email_password', '', NULL, '2022-08-24 22:10:33', 0)
7085ad3 to
75c37d0
Compare
|
I would like to merge this. Can someone approve? If a true Oracle user knows better solution, anytime they can send a PR. |
datamweb
left a comment
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.
LGTM!
See what @MGatner finally says.
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 pinged the only Oracle users I know (at least that I know that I know). This seems like a bigger question than this PR, but the code addresses the problem at hand so let's move forward.
|
🥳 |
Ref #331
Support: