exec('mysql -h' . $this->slaveDbHost . ' ' . $this->sourceDb . ' ' . $this->sourceDBuser . ' ' . $this->sourceDBpassword . ' -N -q -e "SET NAMES binary;SELECT thread.threadid AS thread_id, thread.forumid AS node_id, REPLACE(REPLACE(REPLACE(REPLACE(thread.title, \'&\', \'&\'), \'<\', \'<\'), \'>\', \'>\'), \'"\', \'\\"\') AS title, thread.replycount AS reply_count, thread.views AS view_count, thread.postuserid AS user_id, thread.postusername AS username, thread.dateline AS post_date, thread.sticky, IF(thread.visible = 0, \'moderated\', IF(thread.visible = 2, \'deleted\', \'visible\')) AS discussion_state, thread.open AS disucssion_open, IF(thread.pollid > 0, \'poll\', \'\') AS discussion_type, thread.firstpostid AS first_post_id, (SELECT COUNT(*) FROM ' . self::$tablePrefix . 'reputation as reputation WHERE reputation.postid = thread.firstpostid AND (reputation > 0 OR (reason = \'\' AND reputation = 0))) AS first_post_likes, thread.lastpost AS last_post_date, thread.lastpostid AS last_post_id, ' . (self::$isVB4 ? 'thread.lastposterid' : "'0'") . ' AS last_post_user_id, thread.lastposter AS last_post_username, \'0\' AS prefix_id FROM ' . self::$tablePrefix . 'thread as thread WHERE thread.open != 10 ORDER BY thread.threadid" | ' . self::$sedCommand . ' -r \'s/\&\#[0-9]*?\;//ig\' ' . self::$extraOutCommand . ' > ' . self::$dataDir . 'xf_thread.txt');