[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_5RC1-19184-g3e37bf1

Madhura Jayaratne madhuracj at users.sourceforge.net
Sun Sep 18 13:12:52 CEST 2011


The branch, master has been updated
       via  3e37bf159d2f065745d765ae009c5989fd6dc6bf (commit)
       via  e71182b724bfb111085007b8a77b70ff02db623c (commit)
       via  5cd8af78c3fc587c6d1343bc47d938118f57051a (commit)
      from  20516dc7267fb84e586a6ee9f70db82b12f2e9a7 (commit)


- Log -----------------------------------------------------------------
commit 3e37bf159d2f065745d765ae009c5989fd6dc6bf
Merge: e71182b 20516dc
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sun Sep 18 16:40:52 2011 +0530

    Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit e71182b724bfb111085007b8a77b70ff02db623c
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sun Sep 18 16:36:30 2011 +0530

    Convert bit values to printable form

commit 5cd8af78c3fc587c6d1343bc47d938118f57051a
Author: Madhura Jayaratne <madhura.cj at gmail.com>
Date:   Sun Sep 18 15:43:18 2011 +0530

    Simplify the logic a bit

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

Summary of changes:
 js/tbl_zoom_plot.js |   30 ++++++++++++++++++++++--------
 tbl_zoom_select.php |    8 ++++++++
 2 files changed, 30 insertions(+), 8 deletions(-)

diff --git a/js/tbl_zoom_plot.js b/js/tbl_zoom_plot.js
index 3f8d00b..665a534 100644
--- a/js/tbl_zoom_plot.js
+++ b/js/tbl_zoom_plot.js
@@ -388,16 +388,30 @@ $(document).ready(function() {
                 if (key != 'where_clause') {
                     sql_query += '`' + key + '`=' ;
                     var value = newValues[key];
-                    if (sqlTypes[key] != null && value != null) {
-                        if (sqlTypes[key] == 'bit' && value != '') {
-                            sql_query += 'b\'' + value + '\', ';
+
+                    // null
+                    if (value == null) {
+                        sql_query += 'NULL, ';
+
+                    // empty
+                    } else if ($.trim(value) == '') {
+                        sql_query += "'', ";
+
+                    // other
+                    } else {
+                        // type explicitly identified
+                        if (sqlTypes[key] != null) {
+                            if (sqlTypes[key] == 'bit') {
+                                sql_query += "b'" + value + "', ";
+                            }
+                        // type not explicitly identified
                         } else {
-                            sql_query += '\'\', ';
+                            if (!isNumeric(value)) {
+                                sql_query += "'" + value + "', ";
+                            } else {
+                                sql_query += value + ', ';
+                            }
                         }
-                    } else if (!isNumeric(value) && value != null) {
-                        sql_query += '\'' + value + '\', ';
-                    } else {
-                        sql_query += value + ', ';
                     }
                 }
             }
diff --git a/tbl_zoom_select.php b/tbl_zoom_select.php
index 548b03f..7fabd2f 100644
--- a/tbl_zoom_select.php
+++ b/tbl_zoom_select.php
@@ -42,6 +42,14 @@ if (isset($_REQUEST['get_data_row']) && $_REQUEST['get_data_row'] == true) {
     $result = PMA_DBI_query($row_info_query . ";", null, PMA_DBI_QUERY_STORE);
     $fields_meta = PMA_DBI_get_fields_meta($result);
     while ($row = PMA_DBI_fetch_assoc($result)) {
+        // for bit fields we need to convert them to printable form
+        $i = 0;
+        foreach ($row as $col => $val) {
+            if ($fields_meta[$i]->type == 'bit') {
+                $row[$col] = PMA_printable_bit_value($val, $fields_meta[$i]->length);
+            }
+            $i++;
+        }
         $extra_data['row_info'] = $row;
     }
     PMA_ajaxResponse(null, true, $extra_data);


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list