  |
73 | 73 | | |
| |
74 | 74 | | if (!isset($index[$kname])) { |
| |
75 | 75 | | $index[$kname] = array('unique' => !$keys['Non_unique'], |
  |
| 76 | + | 'fulltext' => ($keys['Index_type'] == 'FULLTEXT' ? '1' : '0'), |
|
76 | 77 | | 'columns' => array()); |
| |
77 | 78 | | } |
| |
78 | 79 | | |
| |
|
|
 |
… |
|
86 | 87 | | |
| |
87 | 88 | | if ($kname == 'PRIMARY') { |
| |
88 | 89 | | $schema .= ' PRIMARY KEY (' . $columns . ')'; |
  |
| 90 | + | } elseif ( $info['fulltext'] == '1' ) { |
| |
| 91 | + | $schema .= ' FULLTEXT ' . $kname . ' (' . $columns . ')'; |
|
89 | 92 | | } elseif ($info['unique']) { |
| |
90 | 93 | | $schema .= ' UNIQUE ' . $kname . ' (' . $columns . ')'; |
| |
91 | 94 | | } else { |
| |
|
|
 |
… |
|
97 | 100 | | fputs($fp, $schema); |
| |
98 | 101 | | |
| |
99 | 102 | | // dump the data |
  |
100 | | - | $rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table); |
| |
101 | | - | while ($rows = tep_db_fetch_array($rows_query)) { |
| |
102 | | - | $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values ('; |
| |
| 103 | + | if ( ($table != TABLE_SESSIONS ) && ($table != TABLE_WHOS_ONLINE) ) { |
| |
| 104 | + | $rows_query = tep_db_query("select " . implode(',', $table_list) . " from " . $table); |
| |
| 105 | + | while ($rows = tep_db_fetch_array($rows_query)) { |
| |
| 106 | + | $schema = 'insert into ' . $table . ' (' . implode(', ', $table_list) . ') values ('; |
|
103 | 107 | | |
  |
104 | | - | reset($table_list); |
| |
105 | | - | while (list(,$i) = each($table_list)) { |
| |
106 | | - | if (!isset($rows[$i])) { |
| |
107 | | - | $schema .= 'NULL, '; |
| |
108 | | - | } elseif (tep_not_null($rows[$i])) { |
| |
109 | | - | $row = addslashes($rows[$i]); |
| |
110 | | - | $row = ereg_replace("\n#", "\n".'\#', $row); |
| |
| 108 | + | reset($table_list); |
| |
| 109 | + | while (list(,$i) = each($table_list)) { |
| |
| 110 | + | if (!isset($rows[$i])) { |
| |
| 111 | + | $schema .= 'NULL, '; |
| |
| 112 | + | } elseif (tep_not_null($rows[$i])) { |
| |
| 113 | + | $row = addslashes($rows[$i]); |
| |
| 114 | + | $row = ereg_replace("\n#", "\n".'\#', $row); |
|
111 | 115 | | |
  |
112 | | - | $schema .= '\'' . $row . '\', '; |
| |
113 | | - | } else { |
| |
114 | | - | $schema .= '\'\', '; |
| |
| 116 | + | $schema .= '\'' . $row . '\', '; |
| |
| 117 | + | } else { |
| |
| 118 | + | $schema .= '\'\', '; |
| |
| 119 | + | } |
|
115 | 120 | | } |
  |
116 | | - | } |
|
117 | 121 | | |
  |
118 | | - | $schema = ereg_replace(', $', '', $schema) . ');' . "\n"; |
| |
119 | | - | fputs($fp, $schema); |
| |
120 | | - | |
| |
| 122 | + | $schema = ereg_replace(', $', '', $schema) . ');' . "\n"; |
| |
| 123 | + | fputs($fp, $schema); |
| |
| 124 | + | } |
|
121 | 125 | | } |
| |
122 | 126 | | } |
| |
123 | 127 | | |
| |
|
|
 |
… |
|
250 | 254 | | tep_db_query($sql_array[$i]); |
| |
251 | 255 | | } |
| |
252 | 256 | | |
  |
| 257 | + | tep_session_close(); |
| |
| 258 | + | |
| |
| 259 | + | tep_db_query("delete from " . TABLE_WHOS_ONLINE); |
| |
| 260 | + | tep_db_query("delete from " . TABLE_SESSIONS); |
| |
| 261 | + | |
  |
253 | 262 | | tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key = 'DB_LAST_RESTORE'"); |
| |
254 | 263 | | tep_db_query("insert into " . TABLE_CONFIGURATION . " values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '" . $read_from . "', 'Last database restore file', '6', '', '', now(), '', '')"); |
| |
255 | 264 | | |