I get a

PDOException: SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (utf8_unicode_ci,IMPLICIT) and (utf8_general_ci,IMPLICIT) for operation '=': SELECT DISTINCT b.module, b.delta FROM {block} b LEFT JOIN {domain_blocks} db ON (b.module = db.module AND b.delta = db.delta) WHERE db.module IS NULL; Array ( ) in domain_blocks_admin_display_submit() (line 246 of /. . . modules/domain_blocks/domain_blocks.module).

both tables - block and domain_blocks are utf8_unicode_ci

this is the code throwing the error

function domain_blocks_admin_display_submit($form, &$form_state) {
$result = db_query("SELECT DISTINCT b.module, b.delta FROM {block} b // <<== this is all of line 246
LEFT JOIN {domain_blocks} db ON (b.module = db.module AND
b.delta = db.delta) WHERE db.module IS NULL"); // <<== this is all of line 246
foreach ($result as $block) {
$id = db_insert('domain_blocks')
->fields(array(
'module' => $block->module,
'delta' => $block->delta,
'realm' => 'domain_site',
'domain_id' => domain_default_id(),
))
->execute();
}
}

Actually:

db_query("SELECT DISTINCT b.module, b.delta FROM {block} b LEFT JOIN {domain_blocks} db ON (b.module = db.module AND b.delta = db.delta) WHERE b.module IS NULL")

Query coder says there is an error in the syntax

Comments

bobburns created an issue.