[wp-trac] [WordPress Trac] #10918: Microsoft SQL Server Support

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 14 00:11:54 UTC 2009


#10918: Microsoft SQL Server Support
--------------------------------------+-------------------------------------
 Reporter:  pmjones                   |        Owner:  westi  
     Type:  feature request           |       Status:  closed 
 Priority:  normal                    |    Milestone:         
Component:  Database                  |      Version:  2.9    
 Severity:  normal                    |   Resolution:  wontfix
 Keywords:  dev-feedback 2nd-opinion  |  
--------------------------------------+-------------------------------------
Changes (by Denis-de-Bernardy):

  * status:  reviewing => closed
  * resolution:  => wontfix
  * milestone:  Future Release =>


Comment:

 these might break plugins:

 {{{
 $query = str_replace('SELECT COUNT(*)', 'SELECT COUNT(*) as Computed',
 $query);
 }}}

 some plugins might use select count(*) as foo, column as bar from...

 {{{
 if ( stripos( $query, 'IF (DATEADD(') > 0 ) {
 }}}

 should be more like:

 {{{
 if ( preg_match('{IF\s*\(\*DATEADD\(' ) {
 }}}

 and many more...

 closing this as wontfix. on a php5.1 server, you can add a wp-
 content/db.php file, that goes as so:


 {{{
 class my_wpdb {
         function __construct($wpdb) {
                 self::$wpdb = $wpdb;
                 if ( !isset(self::$wpdb->queries) )
                         self::$wpdb->queries = array();
         } # __construct()


         function __isset($var) {
                 return isset(self::$wpdb->$var);
         } # __isset()


         function __unset($var) {
                 unset(self::$wpdb->$var);
         } # __unset()


         function __get($var) {
                 return self::$wpdb->$var;
         } # __get()


         function __set($var, $value) {
                 return self::$wpdb->$var = $value;
         } # __set()


         function __call($method, $args) {
                 return call_user_func_array(array(self::$wpdb, $method),
 $args);
         } # __call()
 }

 if ( $wpdb instanceof wpdb )
         $wpdb = new query_cache($wpdb);
 }}}

 then redefine query(), get_var(), get_row() and get_results(). do
 whichever translation you want as needed. and then call parent::query(),
 etc. as needed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10918#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list