Skip to content

[Bug]: result of SHOW GRANTS is abnormal #5716 - #5794

Merged
mergify[bot] merged 10 commits into
matrixorigin:mainfrom
badboynt1:issue5716
Oct 24, 2022
Merged

mergify[bot] merged 10 commits into
matrixorigin:mainfrom
badboynt1:issue5716

Conversation

@badboynt1

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #5716

What this PR does / why we need it:

fix show grants statements

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 20, 2022
@mergify mergify Bot added the kind/bug Something isn't working label Oct 20, 2022
Comment thread pkg/sql/plan/build_show.go Outdated
ddlType := plan.DataDefinition_SHOW_TARGET
sql := ""
if stmt.Hostname == "" {
stmt.Hostname = "localhost"

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's better to use constant var

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.

fixed

stmt.Username = ctx.GetUserName()
}
sql := "select concat(\"GRANT \", p.privilege_level, ' ON ', p.obj_type, \" `%s`\", \"@\", \"`%s`\") as `Grants for %s@localhost` from mo_catalog.mo_user as u, mo_catalog.mo_role_privs as p, mo_catalog.mo_user_grant as g where g.role_id = p.role_id and g.user_id = u.user_id and u.user_name = '%s' and u.user_host = '%s';"
sql = fmt.Sprintf(sql, stmt.Username, stmt.Hostname, stmt.Username, stmt.Username, stmt.Hostname)

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.

sql injection. We need to treat this problem symmetrically.

@mergify
mergify Bot merged commit 2a37476 into matrixorigin:main Oct 24, 2022
daviszhen added a commit to daviszhen/matrixone that referenced this pull request Oct 25, 2022
* add bvt check metric/log table column name (matrixorigin#5860)

add bvt case, help to check column name in metric and log tables.

Approved by: @aressu1985

* disable unique key related bvt in cn-dn (matrixorigin#5861)

Co-authored-by: fengttt <[email protected]>

* When dropping the database, drop all tables are deleted along with it (matrixorigin#5863)

Approved by: @fengttt

* support more jdbc operation (matrixorigin#5857)

support more jdbc operation

Approved by: @daviszhen, @zhangxu19830126, @fengttt, @nnsgmsone, @ouyuanning

* fix issue (matrixorigin#5866)

1, can not delete admin roles
2, can not delete administrator
3, can not delete sys account

Approved by: @aressu1985

* Add rollback to transaction commit failed (matrixorigin#5867)

Approved by: @fengttt, @daviszhen

* fix bug: make sure vector.data is not null when insert rows (matrixorigin#5872)

fix bug: make sure vector.data is not null when insert rows

Approved by: @nnsgmsone

* [Bug]: result of SHOW GRANTS is abnormal matrixorigin#5716 (matrixorigin#5794)

fix show grants statements

Approved by: @reusee, @ouyuanning, @daviszhen, @aunjgr, @aressu1985

* [Bug]: Failed to Connect to MO using "MySQL Workbench" matrixorigin#4530 (matrixorigin#5849)

add variable sql_safe_updates
add support show collation statement

Approved by: @fengttt, @aunjgr, @ouyuanning, @aressu1985, @nnsgmsone, @daviszhen, @iamlinjunhong

* update distributed test case (matrixorigin#5880)

* add sorted in blk meta (matrixorigin#5881)

* add prepare like query (matrixorigin#5887)

Approved by: @aressu1985

* fix bug (matrixorigin#5869)

* fix 5179

* clean

Co-authored-by: fengttt <[email protected]>

* fix bug matrixorigin#5817, do no init createSQL (matrixorigin#5890)

fix bug matrixorigin#5817, do no init createSQL

Approved by: @nnsgmsone

* Fix the bug of zonemap filter (matrixorigin#5894)

* fix type diff (matrixorigin#5893)

* fix distributed missing metric,log case (matrixorigin#5885)

add miss case from test/cases to test/distributed

* refactor move flag/layout to functions (matrixorigin#5888)

refactor: move flag/layout from function to functions

* add_0.6_sql_docs (matrixorigin#5630)

* distributed add prepare like query (matrixorigin#5889)

* add prepare like query

* distributed add prepare like query

* get rows from metaLoc (matrixorigin#5873)

Add get rows from blockInfo

* Update xorfilter&Fix immutable not release bug (matrixorigin#5906)

* sync tenant bvt case to distributed folder (matrixorigin#5907)

changes from matrixorigin#5869

Approved by: @aressu1985

* alter distributed bvt cases (matrixorigin#5902)

* fix func of isUnknwon and fix type of float(255) (matrixorigin#5898)

Approved by: @aressu1985, @ouyuanning

* Fix Agg bug will cause mpool free more than alloc (matrixorigin#5900)

Fix Agg bug will cause mpool free than alloc

Approved by: @nnsgmsone

* test for function regexp (matrixorigin#5822)

Approved by: @aressu1985

* fix bug: null or operator panic (matrixorigin#5908)

fix bug: Bitmap or operator error
thanks @nnsgmsone

* improve: support GetSchemaForAccount to init schema for user account.

* Check Bug (matrixorigin#5913)

* view support SupportAccountAccess

* fix static-check

* fix ut

* rename SupportUserAccess

* flush block base on logtail analysis (matrixorigin#5918)

TAE local changes.

1. Remove old flush block code
2. Flush block based on logtail
3. Add a runner to organize flush block

Approved by: @LeftHandCold

* fix check bug pr (matrixorigin#5921)

* Revert (matrixorigin#5922)

* Revert "fix check bug pr (matrixorigin#5921)"

This reverts commit c0aaf46.

* Revert "Check Bug (matrixorigin#5913)"

This reverts commit aa2650d.

* Enable all tests on e2e. (matrixorigin#5923)

* Add flush-tae-CN-tae-DN config (matrixorigin#5915)

* Add launch-flush-tae-CN-tae-DN

* Update ckp

Co-authored-by: fengttt <[email protected]>

* Update e2e.yml (matrixorigin#5925)

1. use a self-hosted runner instead of GitHub-hosted runner(2c7G) to avoid oom
2. use distribute bvt cases

* modify MergeLogTypeLog -> MergeLogTypeLogs

Co-authored-by: bbbearxyz <[email protected]>
Co-authored-by: fengttt <[email protected]>
Co-authored-by: nnsgmsone <[email protected]>
Co-authored-by: jianwan0214 <[email protected]>
Co-authored-by: daviszhen <[email protected]>
Co-authored-by: ou yuanning <[email protected]>
Co-authored-by: nitao <[email protected]>
Co-authored-by: aptend <[email protected]>
Co-authored-by: tianyahui-python <[email protected]>
Co-authored-by: prinz <[email protected]>
Co-authored-by: GreatRiver <[email protected]>
Co-authored-by: heni02 <[email protected]>
Co-authored-by: iamlinjunhong <[email protected]>
Co-authored-by: chenmingsong <[email protected]>
Co-authored-by: goodMan-code <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: XuPeng-SH <[email protected]>
Co-authored-by: maomao <[email protected]>
@badboynt1
badboynt1 deleted the issue5716 branch October 25, 2022 07:24
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/M Denotes a PR that changes [100,499] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants