mysql 版本 4.0.26
phpbb 程式版本 phpbb3 beta5
在初始化過程中,建立table search_wordlist
# Table: 'phpbb_search_wordlist'
CREATE TABLE phpbb_search_wordlist (
word_id mediumint(8) UNSIGNED NOT NULL auto_increment,
word_text text NOT NULL,
word_common tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (word_id),
UNIQUE wrd_txt (word_text(255))
);
而后在測試中,发帖出错:
代碼: 選擇全部
SQL ERROR [ mysql4 ]
Duplicate entry '送' for key 2 [1062]
SQL
INSERT INTO phpbb3dev_search_wordlist (word_text) VALUES ('送')
BACKTRACE
FILE: includes/db/mysql.php
LINE: 132
CALL: dbal_mysql->sql_error()
FILE: includes/db/dbal.php
LINE: 374
CALL: dbal_mysql->sql_query()
FILE: includes/search/fulltext_native.php
LINE: 1100
CALL: dbal_mysql->sql_multi_insert()
FILE: includes/functions_posting.php
LINE: 1891
CALL: fulltext_native->index()
FILE: posting.php
LINE: 938
CALL: submit_post()在includes/search/fulltext_native.php中,有如下代码:
代碼: 選擇全部
if (sizeof($unique_add_words))
{
$sql = 'SELECT word_id, word_text
FROM ' . SEARCH_WORDLIST_TABLE . '
WHERE ' . $db->sql_in_set('word_text', $unique_add_words);
$result = $db->sql_query($sql);
$word_ids = array();
while ($row = $db->sql_fetchrow($result))
{
$word_ids[$row['word_text']] = $row['word_id'];
}
$db->sql_freeresult($result);
$new_words = array_diff($unique_add_words, array_keys($word_ids));
if (sizeof($new_words))
{
$sql_ary = array();
foreach ($new_words as $word)
{
$sql_ary[] = array('word_text' => $word);
}
$db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary);
}
unset($new_words, $sql_ary);
}抓图如下:
http://www.phpbbchina.com/phpbb3/download.php?id=4&f=2
而后测试在另一主机服务商上的空间,同样版本之mysql却没有问题
不知道这种现象缘何出现?请各位指教
