gpt4 book ai didi

mysql - "type"和 "status"是MySQL中的保留字吗?

转载 作者:可可西里 更新时间:2023-11-01 06:40:36 26 4
gpt4 key购买 nike

我在 MySQL 手册中找不到这些保留字,但显然 phpMyAdmin 说它们是保留字:

enter image description here

最佳答案

从技术上讲,这是 phpMyAdmin 中的错误。来自 libraries/sqlparser.data.php :

/**
* words forbidden to be used as column or table name wihtout quotes
* as seen in http://dev.mysql.com/doc/mysql/en/reserved-words.html
*
* @global array MySQL forbidden words
*/
$PMA_SQPdata_forbidden_word = array (

(列表包括 'STATUS''TYPE',它们显然不在引用手册页上)。

Bug #948确定 phpMyAdmin 当时由于(错误地)被识别为该列表中的保留字而将某些列名称(包括 STATUS)大写;这些关键字最初是 removed结果来自列表,但该提交随后是 reversed , 对于 the reasons explained by Alexander Turek :

Your fix messes up the pretty-printer! This is rather an analyzer problem.

FIRST and STATUS have been inside this reserved words array because they are part of MySQL commands. STATUS is used in "SHOW STATUS" and FIRST part of the ALTER sytax.

Furthermore, this bug affects a lot more words than just STATUS and FIRST. I do not want to know what happens if we remove them all from the reserved words array...

Because of your change, both queries are not highlighted well anymore.

也就是说,phpMyAdmin 使用与检测保留字相同的单词列表在其 pretty-print 中进行语法高亮显示;这是错误的,会导致您看到警告。

关于mysql - "type"和 "status"是MySQL中的保留字吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16593166/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com