Changeset 932
- Timestamp:
- 08/07/08 23:50:46 (20 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/LinkedEntryCustomFields/plugins/LinkedEntryCustomFields/lib/LinkedEntryCustomFields/Convert.pm
r931 r932 26 26 radio => [ 'choices' ], 27 27 entry => [ qw( weblog category_ids ) ], 28 ); 29 30 my %insert_statement_for_ddl_class = ( 31 'MT::ObjectDriver::DDL::mysql' => 'INSERT IGNORE INTO', 32 'MT::ObjectDriver::DDL::SQLite' => 'INSERT OR IGNORE INTO', 28 33 ); 29 34 … … 284 289 ; 285 290 286 # TODO: we should ignore fields that are already set, using INSERT IGNORE 287 # on mysql or INSERT OR IGNORE on sqlite. but if we can't support it on 288 # the other drivers, should we bother? should we delete conflicting data 289 # first from mt_entry_meta so the insert should succeed? 291 # TODO: should we instead delete conflicting data from mt_entry_meta so 292 # an INSERT without IGNORE should succeed? 290 293 # TODO: generic multidatabase support with ORM loop? 291 my $insert_sql = join q{ }, 'INSERT INTO', $meta_table, 294 my $insert_stmt = $insert_statement_for_ddl_class{ $dbd->ddl_class } 295 || 'INSERT INTO'; # we'll have to error if we can't ignore conflicts 296 my $insert_sql = join q{ }, $insert_stmt, $meta_table, 292 297 '(', join(q{, }, @meta_fields), ')', 293 298 'SELECT', $id_col, q{,}, q{?}, q{,},
