PostgreSQL 9.1 allows hex formating for binary which is handled better
by pg_query_params().
Getting bytea isn't required on connection, it can be used as pg_field_type()
when binary needs to be checked.
- With the patch, 6 positions of scale accuracy are guaranteed
per individual casted value.
- Backed with unit tests, both for varchar and clob.
- Added 2 missing tests about uses of the method with params
and values.
Note: 6 was picked because looking to all databases implementation
postgres was found to be casting to real, aka, 6.
Without it, transactions are executed in standard READ_COMMITED
mode, without snapshoting/row versioning, leading to update
conflicts under high concurrency.
Without it, transactions are executed in standard READ_COMMITED
mode, without snapshoting/row versioning, leading to update conflicts
under high concurrency.
While we already were detecting @ normalise_value()
both BLOBs and CLOBs properly on insert and update
statements (by introspectind the column specs), when
a long TEXT is being passed as part of an arbitrary
SQL, or within the conditions... it was being bound
as VARCHAR, leading to problems if used in combination
with DBMS_LOB functions.
This patch just ensures that any TEXT > 4000 bytes not
detected by normalise_value() will be, always, bound as CLOB,
unconditionally.
Covered with tests both covering its use with DBMS_LOB (the
reported bug) and also in general raw statements.
MSSQL's substring() implementation is somehow silly/strict and unable to
perform implicit casts to integer both for the start and length parameters.
This hits Moodle badly because of another problems (MDL-23997) we decided
to cast to string all bound placeholders long ago.
So this commit just enforces the cast of the start and length parameters to
integer. And includes unit tests for using placeholders on all positions in
the sql_substr() method.
This patch includes following fixes:
- messages may be now sent when database transactions active
- consistent return status on failure from message_send(), false is
returned only when message not created in message(_read)? table,
processor failure results in debugging message only and messages
are not marked as read
- message_sent is triggered always with id from message table
- logic for marking messages as viewed was standardised
- message_viewed event is triggered consistently
- improved performance when fetching user preferences
- full unit tests coverage for send_message() function
- fixed multiple other smaller issues discovered by unit tests