Oracle abstraction solves this problem in makeList function ... the only weak point for this solution is if you write SQL statements manualy, if you use Database class functions to create the actual SQL statement this works and as i was told on #mediawiki manual sql creation should gradually be rooted out.
Leons Petrazickis wrote:
The 1.15 release of MediaWiki introduced some hardcoded bitwise operators to the core SQL. They were added to operate on the log_deleted column in the logging table by, I think, aaron. This is because the log_deleted column now has multiple states.
Unfortunately, bitwise operators have different syntax in different databases.
MySQL, PostgreSQL: log_deleted & 1
DB2, Oracle: BITAND(log_deleted, 1)
I think there are three options to make it compatible:
- Refactor the database to not use an integer as a bit field. Just
use four different boolean columns, which works well cross-database.
- Add a function to the Database API for each bit operator.
$sql = $database->bitand('log_deleted', 1);
- Add a function to the Database API to handle all the operators.
$sql = $database->op('&', 'log_deleted', 1); or $sql = $database->op(Database::BITAND, 'log_deleted', 1);
My preference is for option 1 or 3. Thoughts?
Regards,
Leons Petrazickis http://lpetr.org/blog/
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l