Skip to content

dev/reference: update the error code#2213

Merged
lilin90 merged 6 commits into
pingcap:masterfrom
jackysp:update_error_code
Feb 18, 2020
Merged

dev/reference: update the error code#2213
lilin90 merged 6 commits into
pingcap:masterfrom
jackysp:update_error_code

Conversation

@jackysp
Copy link
Copy Markdown
Contributor

@jackysp jackysp commented Feb 6, 2020

Signed-off-by: Shuaipeng Yu jackysp@gmail.com

What is changed, added or deleted?

Update the error code of dev/reference

What is the related PR or file link(s)?

  • Reference link(s):
  • This PR is to align with:
  • N/A (not applicable)

Which TiDB version(s) does your changes apply to?

  • All active versions: dev, v3.0, v2.1, v3.1
  • dev (the latest development version)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)
  • v3.1 (TiDB 3.1 versions)
  • v4.0 (TiDB 4.0 versions)
  • All active and inactive versions
  • N/A (not applicable)

Note: If your changes apply to multiple TiDB versions, make sure you update the documents in the corresponding version folders such as "dev", "v3.0", "v2.1" and "v3.1" in this PR.

  • Updated one version first. Will update other versions after I get two LGTMs.

Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
@jackysp jackysp requested review from bb7133 and lilin90 February 6, 2020 05:43
@jackysp jackysp added v4.0 This PR/issue applies to TiDB v4.0. dev labels Feb 6, 2020
Comment thread dev/reference/error-codes.md Outdated
Comment on lines +68 to +69
| 8103 | 插件名称错误 |
| 8104 | 插件版本错误 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps s/错误/不匹配 will be more informative

Comment thread dev/reference/error-codes.md Outdated
| 8102 | 无法读取插件定义信息 |
| 8103 | 插件名称错误 |
| 8104 | 插件版本错误 |
| 8105 | 插件被重复载入错误 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest remove 错误

Comment thread dev/reference/error-codes.md Outdated
| 8104 | 插件版本错误 |
| 8105 | 插件被重复载入错误 |
| 8106 | 插件定义的系统变量名称没有以插件名作为开头 |
| 8107 | 载入的插件版本太低 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that if the plugin doesn't have version number will also cause this error

// plugin.go:122
		for component, reqVer := range p.RequireVersion {
			if ver, ok := tiPlugins.versions[component]; !ok || ver < reqVer {
				return errRequireVersionCheckFail.GenWithStackByArgs(p.Name, component, reqVer, ver)
			}
		}

So 载入的插件未指定版本或指定的版本过低 would be more clear

Comment thread dev/reference/error-codes.md Outdated
| 8114 | 未知的执行计划类型 |
| 8115 | 不支持 prepare 多行语句 |
| 8116 | 不支持 prepare DDL 语句 |
| 8117 | 内部 SQL 没有读到指定的系统变量 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt this error is caused by system variable, it seems it is because of empty result set, see

// getExecRet executes restricted sql and the result is one column.
// It returns a string value.
func (s *session) getExecRet(ctx sessionctx.Context, sql string) (string, error) {
	rows, fields, err := s.ExecRestrictedSQL(sql)
	if err != nil {
		return "", err
	}
	if len(rows) == 0 {
		return "", executor.ErrResultIsEmpty
	}
	d := rows[0].GetDatum(0, &fields[0].Column.FieldType)
	value, err := d.ToString()
	if err != nil {
		return "", err
	}
	return value, nil
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it, it will be replaced by ErrUnknownSystemVar in GetGlobalSysVar.

Comment thread dev/reference/error-codes.md Outdated
| 8115 | 不支持 prepare 多行语句 |
| 8116 | 不支持 prepare DDL 语句 |
| 8117 | 内部 SQL 没有读到指定的系统变量 |
| 8118 | 构建执行算子失败 |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/算子/器

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or 执行器构建失败

@ichn-hu
Copy link
Copy Markdown
Contributor

ichn-hu commented Feb 6, 2020

Also ErrBatchInsertFail = 8119 is missing, is it intentional?

@pingcap pingcap deleted a comment from jackysp Feb 6, 2020
@jackysp
Copy link
Copy Markdown
Contributor Author

jackysp commented Feb 7, 2020

Also ErrBatchInsertFail = 8119 is missing, is it intentional?

The docs of batch insert have already deleted in #2194. So we should not expose its error code.

Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Copy link
Copy Markdown
Contributor

@ichn-hu ichn-hu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread dev/reference/error-codes.md Outdated
| 8204 | 非法的 DDL job |
| 8205 | 非法的 DDL job 标志 |
| 8206 | DDL 的 Reorg 阶段执行超时 |
| 8207 | 非法的存储节点 |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 8208 and 8209 is not listed? Is there any reason? I think we can simply list them all here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not used anywhere.

Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Co-Authored-By: bb7133 <bb7133@gmail.com>
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Comment thread dev/reference/error-codes.md Outdated
Copy link
Copy Markdown
Member

@lilin90 lilin90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lilin90 lilin90 added the translation/doing This PR’s assignee is translating this PR. label Feb 18, 2020
@lilin90 lilin90 assigned ran-huang and unassigned junlan-zhang Feb 18, 2020
@lilin90 lilin90 merged commit 5faceb3 into pingcap:master Feb 18, 2020
@ran-huang ran-huang removed the translation/doing This PR’s assignee is translating this PR. label Feb 19, 2020
@ran-huang ran-huang added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed aligning labels Feb 19, 2020
@jackysp jackysp deleted the update_error_code branch March 18, 2020 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. v4.0 This PR/issue applies to TiDB v4.0.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants