Changeset 264
- Timestamp:
- 06/25/09 21:44:34 (3 years ago)
- File:
-
- 1 edited
-
trunk/includes/class.bp-sql-schema-parser.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/class.bp-sql-schema-parser.php
r262 r264 17 17 } 18 18 19 $null = ''; 19 20 if ( $column_data['Null'] == 'NO' ) { 20 21 $null = 'NOT NULL'; 21 } else {22 $null = '';23 22 } 24 23 … … 137 136 'Seq_in_index' => (string) ( $_index_columns_index + 1 ), 138 137 'Column_name' => $_matches_column[1], 139 'Sub_part' => isset($_matches_column[2]) ? $_matches_column[2] : null,138 'Sub_part' => ( isset( $_matches_column[2] ) && $_matches_column[2] ) ? $_matches_column[2] : null, 140 139 'Index_type' => ( 'FULLTEXT KEY' == $_index_type ) ? 'FULLTEXT' : 'BTREE' 141 140 ); … … 147 146 148 147 // Tidy the NOT NULL 149 $_matches[5] = isset( $_matches[5]) ? strtoupper( preg_replace( '@\s+@', ' ', trim( $_matches[5] ) ) ) : null;148 $_matches[5] = isset( $_matches[5] ) ? strtoupper( preg_replace( '@\s+@', ' ', trim( $_matches[5] ) ) ) : ''; 150 149 151 150 $_columns[$_matches[1]] = array( 152 151 'Field' => $_matches[1], 153 'Type' => ( is set($_matches[4]) ?( is_numeric( $_matches[3] ) ) ? $_matches[2] . '(' . $_matches[3] . ')' . ( ( strtolower( $_matches[4] ) == 'unsigned' ) ? ' unsigned' : '' ) : $_matches[2] : null),152 'Type' => ( is_numeric( $_matches[3] ) ) ? $_matches[2] . '(' . $_matches[3] . ')' . ( ( isset( $_matches[4] ) && strtolower( $_matches[4] ) == 'unsigned' ) ? ' unsigned' : '' ) : $_matches[2], 154 153 'Null' => ( 'NOT NULL' == strtoupper( $_matches[5] ) ) ? 'NO' : 'YES', 155 'Default' => ( isset( $_matches[7]) ? ( 'default' == strtolower( $_matches[7] ) && 'NULL' !== strtoupper( $_matches[8] ) ) ? trim( $_matches[8], "'" ) : null : null),156 'Extra' => ( isset( $_matches[6]) ? ( 'auto_increment' == strtolower( $_matches[6] ) ) ? 'auto_increment' : '' : null)154 'Default' => ( isset( $_matches[7] ) && 'default' == strtolower( $_matches[7] ) && 'NULL' !== strtoupper( $_matches[8] ) ) ? trim( $_matches[8], "'" ) : null, 155 'Extra' => ( isset( $_matches[6] ) && 'auto_increment' == strtolower( $_matches[6] ) ) ? 'auto_increment' : '' 157 156 ); 158 157 }
Note: See TracChangeset
for help on using the changeset viewer.
