feat: support other databases#402
Conversation
| $this->disableDBDebug(); | ||
|
|
||
| if ($this->db->getPlatform() === 'OCI8' && $identifier === '') { | ||
| $identifier = ' '; |
There was a problem hiding this comment.
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.
I'm not sure.
Oracle sees '' as NULL.
There was a problem hiding this comment.
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.
@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.
@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.
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.
@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. |
|
🥳 |
Ref #331
Support: