[Phpmyadmin-git] [SCM] phpMyAdmin branch, QA_3_4, updated. RELEASE_3_4_2RC1-6-g612f8f3

Madhura Jayaratne madhuracj at users.sourceforge.net
Fri Jun 3 20:34:12 CEST 2011


The branch, QA_3_4 has been updated
       via  612f8f3d67aea31debdc7df83bc6628997e6aade (commit)
      from  ab1a2394c3df043d81080792028ed739338674f5 (commit)


- Log -----------------------------------------------------------------
commit 612f8f3d67aea31debdc7df83bc6628997e6aade
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sat Jun 4 00:02:11 2011 +0530

    Partial fix for bug #3291306 - Inline edit does not honor bit fields. Works with mysqli extension.

-----------------------------------------------------------------------

Summary of changes:
 js/sql.js                     |   12 ++++++++++--
 libraries/display_tbl.lib.php |    9 +++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/js/sql.js b/js/sql.js
index 32a5bba..8a3e25f 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -888,16 +888,20 @@ $(document).ready(function() {
              */
             var is_null = $this_field.find('input:checkbox').is(':checked');
             var value;
+            var addQuotes = true;
 
             if (is_null) {
                 sql_query += ' `' + field_name + "`=NULL , ";
                 need_to_post = true;
             } else {
-                if($this_field.is(":not(.relation, .enum, .set)")) {
+                if($this_field.is(":not(.relation, .enum, .set, .bit)")) {
                     this_field_params[field_name] = $this_field.find('textarea').val();
                     if($this_field.is('.transformed')) {
                         $.extend(transform_fields, this_field_params);
                     }
+                } else if ($this_field.is('.bit')) {
+                    this_field_params[field_name] = '0b' + $this_field.find('textarea').val();
+                    addQuotes = false;
                 } else if ($this_field.is('.set')) {
                     $test_element = $this_field.find('select');
                     this_field_params[field_name] = $test_element.map(function(){
@@ -924,7 +928,11 @@ $(document).ready(function() {
                         new_clause += '`' + window.parent.table + '`.' + '`' + field_name + "` = '" + this_field_params[field_name].replace(/'/g,"''") + "'" + ' AND ';
                     }
                 if (this_field_params[field_name] != $this_field.data('original_data')) {
-                    sql_query += ' `' + field_name + "`='" + this_field_params[field_name].replace(/'/g, "''") + "' , ";
+                    if (addQuotes == true) {
+                        sql_query += ' `' + field_name + "`='" + this_field_params[field_name].replace(/'/g, "''") + "', ";
+                    } else {
+                        sql_query += ' `' + field_name + "`=" + this_field_params[field_name].replace(/'/g, "''") + ", ";
+                    }
                     need_to_post = true;
                 }
             }
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index fc1fcf2..c0ab854 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -445,7 +445,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
     global $sql_query, $num_rows;
     global $vertical_display, $highlight_columns;
 
-    // required to generate sort links that will remember whether the 
+    // required to generate sort links that will remember whether the
     // "Show all" button has been clicked
     $sql_md5 = md5($GLOBALS['sql_query']);
     $session_max_rows = $_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows'];
@@ -1026,6 +1026,11 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_trunca
         $set_class = ' set';
     }
 
+    $bit_class = '';
+    if(strpos($meta->type, 'bit') !== false) {
+        $bit_class = ' bit';
+    }
+
     $mime_type_class = '';
     if(isset($meta->mimetype)) {
         $mime_type_class = ' ' . preg_replace('/\//', '_', $meta->mimetype);
@@ -1034,7 +1039,7 @@ function PMA_addClass($class, $condition_field, $meta, $nowrap, $is_field_trunca
     $result = $class . ($condition_field ? ' condition' : '') . $nowrap
     . ' ' . ($is_field_truncated ? ' truncated' : '')
     . ($transform_function != $default_function ? ' transformed' : '')
-    . $enum_class . $set_class . $mime_type_class;
+    . $enum_class . $set_class . $bit_class . $mime_type_class;
 
     return $result;
 }


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list