The branch, master has been updated
       via  cb9f7a2c26737fd0a2bc004bd289c3309dc7a78b (commit)
       via  a3f14bbd801540b7971601ccf4d3f221d53dbc79 (commit)
      from  5624ed3dc0dd446fe6646db43c57a473026ca1d2 (commit)


- Log -----------------------------------------------------------------
commit cb9f7a2c26737fd0a2bc004bd289c3309dc7a78b
Author: Michal Čihař <[email protected]>
Date:   Fri Aug 19 11:15:31 2011 +0200

    Clarify code

commit a3f14bbd801540b7971601ccf4d3f221d53dbc79
Author: Michal Čihař <[email protected]>
Date:   Fri Aug 19 11:15:24 2011 +0200

    Fix indentation

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

Summary of changes:
 libraries/Table.class.php |   44 ++++++++++++++++++++++++--------------------
 1 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/libraries/Table.class.php b/libraries/Table.class.php
index d018cd7..cdc3224 100644
--- a/libraries/Table.class.php
+++ b/libraries/Table.class.php
@@ -362,24 +362,26 @@ class PMA_Table
         }
 
         switch ($default_type) {
-            case 'USER_DEFINED' :
-                if ($is_timestamp && $default_value === '0') {
-                    // a TIMESTAMP does not accept DEFAULT '0'
-                    // but DEFAULT 0 works
-                    $query .= ' DEFAULT 0';
-                } elseif ($type == 'BIT') {
-                    $query .= ' DEFAULT b\'' . preg_replace('/[^01]/', '0', 
$default_value) . '\'';
-                } else {
-                    $query .= ' DEFAULT \'' . 
PMA_sqlAddSlashes($default_value) . '\'';
-                }
-                break;
-            case 'NULL' :
-            case 'CURRENT_TIMESTAMP' :
-                $query .= ' DEFAULT ' . $default_type;
-                break;
-            case 'NONE' :
-            default :
-                break;
+        case 'USER_DEFINED' :
+            if ($is_timestamp && $default_value === '0') {
+                // a TIMESTAMP does not accept DEFAULT '0'
+                // but DEFAULT 0 works
+                $query .= ' DEFAULT 0';
+            } elseif ($type == 'BIT') {
+                $query .= ' DEFAULT b\''
+                        . preg_replace('/[^01]/', '0', $default_value)
+                        . '\'';
+            } else {
+                $query .= ' DEFAULT \'' . PMA_sqlAddSlashes($default_value) . 
'\'';
+            }
+            break;
+        case 'NULL' :
+        case 'CURRENT_TIMESTAMP' :
+            $query .= ' DEFAULT ' . $default_type;
+            break;
+        case 'NONE' :
+        default :
+            break;
         }
 
         if (!empty($extra)) {
@@ -389,8 +391,10 @@ class PMA_Table
             if ($extra == 'AUTO_INCREMENT') {
                 $primary_cnt = count($field_primary);
                 if (1 == $primary_cnt) {
-                    for ($j = 0; $j < $primary_cnt && $field_primary[$j] != 
$index; $j++) {
-                        //void
+                    for ($j = 0; $j < $primary_cnt; $j++) {
+                        if ($field_primary[$j] == $index) {
+                            break;
+                        }
                     }
                     if (isset($field_primary[$j]) && $field_primary[$j] == 
$index) {
                         $query .= ' PRIMARY KEY';


hooks/post-receive
-- 
phpMyAdmin

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Phpmyadmin-git mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpmyadmin-git

Reply via email to