This didn't even come up on my radar as I began working on integrating the 1.15.0 changes into the Microsoft SQL Server version. Here's why: It didn't break anything. The only noticeable database-related breakage recently has been with the Special:RecentChanges and Special:RecentChangesLinked pages, which use LIMIT and ORDER BY together with UNION in a way not supported by SQL Server. So, you can update your summary of the bitwise operator syntax in different databases to reflect that.
MySQL, PostgeSQL, SQL Server log_deleted & 1
On Fri, Jun 12, 2009 at 10:06 AM, Freako F. Freakolowskyfreak@drajv.si wrote:
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
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l