mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-30 10:58:24 +00:00
Add workaround for empty strings being null in Oracle
Oracle historically treats empty VARCHAR[2] column values as nulls, so we need to adjust the string length unit test to provide indicators when retrieving the value of a possibly null string and use nvl() to compute its length to make this test pass when using this backend.
This commit is contained in:
@@ -1173,9 +1173,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual std::string get_length_function_name() const
|
||||
virtual std::string sql_length(std::string const& s) const
|
||||
{
|
||||
return "char_length";
|
||||
return "char_length(" + s + ")";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user