Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1405aa

Browse files
committed
Add input function for data type pg_dependencies
pg_dependencies is used as data type for the contents of dependenciesextended statistics. This new input function consumes the format thathas been established bye76defb for the output function ofpg_dependencies, enforcing some sanity checks for:- Checks for the input object, which should be a one-dimension arraywith correct attributes and values.- The key names: "attributes", "dependency", "degree". All arerequired, other key names are blocked.- Value types for each key: "attributes" requires an array of integers,"dependency" an attribute number, "degree" a float.- List of attributes. In this case, it is possible that somedependencies are not listed in the statistics data, as items with adegree of 0 are discarded when building the statistics. This commitincludes checks for simple scenarios, like duplicated attributes, oroverlapping values between the list of "attributes" and the "dependency"value. Even if the input function considers the input as valid, a valuestill needs to be cross-checked with the attributes defined in astatistics object at import.- Based on the discussion, the checks on the values are loose, as thereis also an argument for potentially stats injection. For example,"degree" should be defined in [0.0,1.0], but a check is not enforced.This is required for a follow-up patch that aims to implement the importof extended statistics. Some tests are added to check the code paths ofthe JSON parser checking the shape of the pg_dependencies inputs, with91% of code coverage reached. The tests are located in their own newtest file, for clarity.Author: Corey Huinker <corey.huinker@gmail.com>Reviewed-by: Jian He <jian.universality@gmail.com>Reviewed-by: Chao Li <li.evan.chao@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Yuefei Shi <shiyuefei1004@gmail.com>Discussion:https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com
1 parent44eba8f commite1405aa

File tree

5 files changed

+1459
-9
lines changed

5 files changed

+1459
-9
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp