Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser/parser.y: S/R conflicts 1->0. #122

Merged
merged 1 commit into from
Sep 11, 2015
Merged

parser/parser.y: S/R conflicts 1->0. #122

merged 1 commit into from
Sep 11, 2015

Conversation

cznic
Copy link

@cznic cznic commented Sep 11, 2015

state 696 // alter tableKwd after charsetKwd after [$end]

  484 TableOptListOpt: TableOptList .  [$end, ',', ';']
  486 TableOptList: TableOptList . TableOpt
  487 TableOptList: TableOptList . ',' TableOpt
   99 DefaultKwdOpt: .  [character, charsetKwd, collation]

    $end           reduce using rule 484 (TableOptListOpt)
    ','            shift, and goto state 699
    ';'            reduce using rule 484 (TableOptListOpt)
    autoIncrement  shift, and goto state 695
    character      reduce using rule 99 (DefaultKwdOpt)
    charsetKwd     reduce using rule 99 (DefaultKwdOpt)
    collation      reduce using rule 99 (DefaultKwdOpt)
    defaultKwd     shift, and goto state 654
    engine         shift, and goto state 693

    DefaultKwdOpt  goto state 694
    TableOpt       goto state 698

    conflict on ',', shift, and goto state 699, reduce using rule 484
(15:02) jnml@r550:~/src/github.com/cznic/tidb/parser$ goyacc -o /dev/null -cr parser.y
Parse table entries: 124933 of 382547, x 16 bits == 249866 bytes
(15:02) jnml@r550:~/src/github.com/cznic/tidb/parser$ 

WARNING: This PR removes the CommaOpt item in the CreateTableStmt production. Looking at MySQL docs, I believe it should not be accepted in this part of the grammar. However, if I'm mistaken, then you should not merge this PR and please let me know why CommaOpt is there - as the proper solution would have to be different (if it then exists at all).

@siddontang
Copy link
Member

Thanks @cznic

We can execute create table if not exists t (c1 int); in MySQL command shell, so we support CommaOpt here.

Maybe we can remove the ; at first before parsing? @shenli

@cznic
Copy link
Author

cznic commented Sep 11, 2015

Comma is ',', not ';', that's a semicolon. IOW, now I'm confused even more ;-)

@siddontang
Copy link
Member

Sorry for my fault. @cznic , I am wrong.
Comma is not allowed, I think too.

@shenli
Copy link
Member

shenli commented Sep 11, 2015

LGTM
@siddontang I think the CommaOpt should not be here. The parser parse text into statement list, and ';' will be treated as separator between statements. So it is not necessary to add ';' at the end of create statement rule.
Thanks a lot! @cznic

@coocood
Copy link
Member

coocood commented Sep 11, 2015

LGTM

Wow! All conflicts are resolved.
Great job, thank you.

coocood added a commit that referenced this pull request Sep 11, 2015
parser/parser.y: S/R conflicts 1->0.
@coocood coocood merged commit 341785e into pingcap:master Sep 11, 2015
@shenli
Copy link
Member

shenli commented Sep 11, 2015

I think we should add syntax conflict detection in Makefile to prevent future bugs. I will add an issue.

@sre-bot sre-bot added the contribution This PR is from a community contributor. label Dec 18, 2019
YuJuncen pushed a commit to YuJuncen/tidb that referenced this pull request Apr 23, 2021
* *: remove vendor

* lightning: replace deprecated prometheus.Handler by promhttp.Handler

* go.mod: update all dependencies except TiDB

* *: changed pkg/errors to pingcap/errors

This is to avoid the "used for two different module paths" error, since
TiDB no longer replaces pkg/errors with pingcap/errors but uses the latter
directly.

* CONTRIBUTING: update the guide, we no longer vendor/
YuJuncen pushed a commit to YuJuncen/tidb that referenced this pull request Apr 23, 2021
* restore: support batch split

Signed-off-by: 5kbpers <[email protected]>

* go mod tidy

Signed-off-by: 5kbpers <[email protected]>

* address lint

Signed-off-by: 5kbpers <[email protected]>

Co-authored-by: Neil Shen <[email protected]>
xhebox pushed a commit to xhebox/tidb that referenced this pull request Sep 28, 2021
xhebox pushed a commit to xhebox/tidb that referenced this pull request Oct 8, 2021
okJiang pushed a commit to okJiang/tidb that referenced this pull request Oct 19, 2021
* support specify ouput filename format

* revise variable name

* address comments

* try to address comment

* address comment
nolouch pushed a commit to tidblabs/tidb that referenced this pull request Jan 6, 2023
* BR adaption for keyspace feature (pingcap#38)

Signed-off-by: iosmanthus <[email protected]>
Co-authored-by: ystaticy <[email protected]>
Co-authored-by: disksing <[email protected]>

* build br image (pingcap#62)

* build br image

Signed-off-by: disksing <[email protected]>

* BR: Serverless Compatible BR (pingcap#64)

* disable remove scheduler and other pd related modifications when keyspace is set for BR

Signed-off-by: David <[email protected]>

* make tidb br forward compatible (pingcap#84)

* make tidb br forward compatible

Signed-off-by: iosmanthus <[email protected]>

* fix bug,when tables>0 and file=0

Signed-off-by: ystaticy <[email protected]>

* go mod tidy

Signed-off-by: iosmanthus <[email protected]>

Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: ystaticy <[email protected]>
Co-authored-by: ystaticy <[email protected]>

* Cse BR restore only download on leader (pingcap#120)

* cse br restore,only download in region leader

* support config

Signed-off-by: ystaticy <[email protected]>

* cse br restore,only download in region leader

Signed-off-by: ystaticy <[email protected]>

* cse br restore,only download in region leader

Signed-off-by: ystaticy <[email protected]>

* fix logs

Signed-off-by: ystaticy <[email protected]>

* fix logs

Signed-off-by: ystaticy <[email protected]>

* fix logs

Signed-off-by: ystaticy <[email protected]>

* remove unused code

Signed-off-by: ystaticy <[email protected]>

* fix imports

Signed-off-by: ystaticy <[email protected]>

* fix comments

Signed-off-by: ystaticy <[email protected]>

* fix config of leaderdownload

Signed-off-by: ystaticy <[email protected]>

* fix config of leaderdownload

Signed-off-by: ystaticy <[email protected]>

* if met not leader error.return error immediately.

Signed-off-by: ystaticy <[email protected]>

Signed-off-by: ystaticy <[email protected]>

* support skip split option for small dataset (pingcap#122)

* support skip split option for small dataset

Signed-off-by: iosmanthus <[email protected]>

* disable SplitTable only when skip split

Signed-off-by: iosmanthus <[email protected]>

* rename api version of FileImporter

Signed-off-by: iosmanthus <[email protected]>

Signed-off-by: iosmanthus <[email protected]>

Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: disksing <[email protected]>
Signed-off-by: David <[email protected]>
Signed-off-by: ystaticy <[email protected]>
Co-authored-by: ystaticy <[email protected]>
Co-authored-by: disksing <[email protected]>
Co-authored-by: David <[email protected]>
zhongzc pushed a commit to zhongzc/tidb that referenced this pull request Feb 17, 2023
* Cse BR restore only download on leader (pingcap#120)

* cse br restore,only download in region leader

* support config

Signed-off-by: ystaticy <[email protected]>

* cse br restore,only download in region leader

Signed-off-by: ystaticy <[email protected]>

* cse br restore,only download in region leader

Signed-off-by: ystaticy <[email protected]>

* fix logs

Signed-off-by: ystaticy <[email protected]>

* fix logs

Signed-off-by: ystaticy <[email protected]>

* fix logs

Signed-off-by: ystaticy <[email protected]>

* remove unused code

Signed-off-by: ystaticy <[email protected]>

* fix imports

Signed-off-by: ystaticy <[email protected]>

* fix comments

Signed-off-by: ystaticy <[email protected]>

* fix config of leaderdownload

Signed-off-by: ystaticy <[email protected]>

* fix config of leaderdownload

Signed-off-by: ystaticy <[email protected]>

* if met not leader error.return error immediately.

Signed-off-by: ystaticy <[email protected]>

Signed-off-by: ystaticy <[email protected]>

* support skip split option for small dataset (pingcap#122)

* support skip split option for small dataset

Signed-off-by: iosmanthus <[email protected]>

* disable SplitTable only when skip split

Signed-off-by: iosmanthus <[email protected]>

* rename api version of FileImporter

Signed-off-by: iosmanthus <[email protected]>

Signed-off-by: iosmanthus <[email protected]>

* remove blank line

Signed-off-by: zeminzhou <[email protected]>

* for cse

Signed-off-by: zeminzhou <[email protected]>

* add reload expr_pushdown_blacklist for br

Signed-off-by: zeminzhou <[email protected]>

* remove reload

Signed-off-by: zeminzhou <[email protected]>

* support rewrite tikv min version

Signed-off-by: zeminzhou <[email protected]>

* add comment

Signed-off-by: zeminzhou <[email protected]>

* move downloadleader to restore config

Signed-off-by: zeminzhou <[email protected]>

---------

Signed-off-by: ystaticy <[email protected]>
Signed-off-by: iosmanthus <[email protected]>
Signed-off-by: zeminzhou <[email protected]>
Co-authored-by: ystaticy <[email protected]>
Co-authored-by: iosmanthus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution This PR is from a community contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants