【发布时间】:2020-01-24 17:19:07
【问题描述】:
我正在尝试使用本指南在 Windows 10 机器上安装 Bugzilla:
https://bugzilla.readthedocs.io/en/latest/installing/windows.html#
Apache 2.4、Perl 5.28.2 和 MySQL 8.0 已安装并正常运行。我已经使用“install-modules.pl --all”命令安装了所有必需的 Perl 模块。我可以打开 Bugzilla 页面,尽管它是纯文本版本。
问题是上次运行 checksetup.pl。它检查所有已安装的模块,然后给我这个:
Removing existing compiled templates...
Precompiling templates...done.
Initializing "Dependency Tree Changes" email_setting ...
Initializing "Product/Component Changes" email_setting ...
Use of uninitialized value in numeric eq (==) at Bugzilla/Install/DB.pm line 2688.
The regular expression you provided '^[^,]+{' is not valid. The error
was: Syntax error in regular expression on line 1, character 7..
我在sub _add_password_salt_separator 的DB.pm 文件中找到了正则表达式。 (第 4110 行)
这是似乎是问题孩子的代码块:
my $profiles
= $dbh->selectall_arrayref(
"SELECT userid, cryptpassword FROM profiles WHERE ("
. $dbh->sql_regexp("cryptpassword", "'^[^,]+{'")
. ")");
我尝试重新加载 Bugzilla 以查看是否只是下载或配置的问题,但在第 3 轮之后,我仍然收到相同的错误。
我尝试查找表达式,但似乎没有任何意义。我不熟悉正则表达式,所以我不知道该去哪里解决这个问题。任何帮助让这个系统运行都非常感谢。
【问题讨论】:
-
我尝试进行更改,但它仍然给了我错误:
The regular expression you provided '^[^,]+\{' is not valid. -
您可以
echo "SELECT userid, cryptpassword FROM profiles WHERE (" . $dbh->sql_regexp("cryptpassword", "'^[^,]+{'") . ")"并将输出添加到您的问题详细信息中吗?这将使您更清楚地了解您的字符串连接是否产生了有效的 SQL 语句。对我来说,开始和结束引号'看起来很可疑,尤其是因为^表示正则表达式中字符串的开始。 -
@ikegami 所以是
character 7来自错误引用]或+? -
所以添加
"'^[^,]+\\\\{'"允许它继续但现在出现另一个错误:electcol_arrayref failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near [SQL Command] at Bugzilla/DB.pm line 1521 -
` Bugzilla::DB::_check_references(Bugzilla::DB::Mysql=HASH(0xb4eb848), "bug_group_map", "group_id", HASH(0xee7a610)) 在 Bugzilla/DB.pm 调用第 663 行 Bugzilla::DB::bz_add_fks(Bugzilla::DB::Mysql=HASH(0xb4eb848), "bug_group_map", HASH(0xaa0a7d0), HASH(0xee7a640)) 在 Bugzilla/DB.pm 第 581 行调用 Bugzilla::DB ::bz_setup_foreign_keys(Bugzilla::DB::Mysql=HASH(0xb4eb848)) 在 Bugzilla/Install/DB.pm 第 748 行调用 Bugzilla::Install::DB::update_table_definitions(HASH(0x2ec9590)) 在 C:\bugzilla 调用\checksetup.pl 第 175 行`