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

Migration script with ddl.set_schema() fails if it has index definition with exclude_null #110

Closed
dkasimovskiy opened this issue Jun 20, 2023 · 0 comments · Fixed by #111
Assignees
Labels
1sp bug Something isn't working teamE

Comments

@dkasimovskiy
Copy link

Migration script with ddl.set_schema() fails if it has index definition with exclude_null option in index parts.
There are to different error depending on presence is_nullable = false, option in definition.

Migration script:

return {
    up = function()

        local ddl = require('ddl')
        local schema = {
            spaces = {
                message = {
                    engine = 'memtx',
                    is_local = false,
                    temporary = false,
                    format = {
                        { name = 'id', type = 'integer', is_nullable = false },
                        { name = 'bucket_id', type = 'unsigned', is_nullable = false },
                        { name = 'user_key', type = 'string', is_nullable = false },
                        { name = 'package_id', type = 'integer', is_nullable = true }
                    },
                    indexes = {
                        {
                            name = 'primary',
                            type = 'TREE',
                            unique = true,
                            parts = {
                                {
                                    path = 'id',
                                    is_nullable = false,
                                    type = 'integer'
                                }
                            }
                        },
                        {
                            name = 'bucket_id',
                            type = 'TREE',
                            unique = false,
                            parts = {
                                {
                                    path = 'bucket_id',
                                    is_nullable = false,
                                    type = 'unsigned'
                                }
                            }
                        },
                        {
                            name = 'package_id_idx',
                            type = 'TREE',
                            unique = false,
                            parts = {
                                {
                                    path = 'package_id',
                                    exclude_null = true,
                                    type = 'integer'
                                }
                            }
                        }
                    },
                    sharding_key = { 'id' }
                }
            }
        }

        ddl.set_schema(schema)

        return ddl.check_schema(schema)
    end
}
@LeonidVas LeonidVas added bug Something isn't working teamE 1sp labels Jun 23, 2023
@DifferentialOrange DifferentialOrange self-assigned this Jun 26, 2023
DifferentialOrange added a commit that referenced this issue Jun 26, 2023
Add exclude_null support for indexes. The option was introduced in
Tarantool 2.8.1 [1] for nullable TREE indexes.

Since ddl approach is "require explicit fields rather than fill with
sane defaults" (for example, one must explicitly set is_nullable for
each field), we do not add "if exclude_null=true and is_nullable is not
provided, set is_nullable=true" rule from the core Tarantool [1]:
we require to explicitly specify both fields, if one wants to use
exclude_null features.

1. tarantool/tarantool@17c9c03

Closes #110
DifferentialOrange added a commit that referenced this issue Jun 26, 2023
Add exclude_null support for indexes. The option was introduced in
Tarantool 2.8.1 [1] for nullable TREE indexes.

Since ddl approach is "require explicit fields rather than fill with
sane defaults" (for example, one must explicitly set is_nullable for
each field), we do not add "if exclude_null=true and is_nullable is not
provided, set is_nullable=true" rule from the core Tarantool [1]:
we require to explicitly specify both fields, if one wants to use
exclude_null features.

1. tarantool/tarantool@17c9c03

Closes #110
AnaNek pushed a commit that referenced this issue Jun 29, 2023
Add exclude_null support for indexes. The option was introduced in
Tarantool 2.8.1 [1] for nullable TREE indexes.

Since ddl approach is "require explicit fields rather than fill with
sane defaults" (for example, one must explicitly set is_nullable for
each field), we do not add "if exclude_null=true and is_nullable is not
provided, set is_nullable=true" rule from the core Tarantool [1]:
we require to explicitly specify both fields, if one wants to use
exclude_null features.

1. tarantool/tarantool@17c9c03

Closes #110
DifferentialOrange added a commit that referenced this issue Jun 29, 2023
"Test" workflow installs latest luatest, yet "Reusable test" installs
luatest 0.5.7. Latest e2cdb56 commit had introduced tests which use
some luatest master utils. These tests fails on "Reusable test",
see [1].

1. https://github.com/tarantool/tarantool/actions/runs/5411519721/jobs/9835738155

Follows #110
AnaNek pushed a commit that referenced this issue Jun 29, 2023
"Test" workflow installs latest luatest, yet "Reusable test" installs
luatest 0.5.7. Latest e2cdb56 commit had introduced tests which use
some luatest master utils. These tests fails on "Reusable test",
see [1].

1. https://github.com/tarantool/tarantool/actions/runs/5411519721/jobs/9835738155

Follows #110
DifferentialOrange added a commit that referenced this issue Jul 5, 2023
Overview

  This release introduces exclude_null support.

New features
  - Added exclude_null support for indexes (#110).
DifferentialOrange added a commit that referenced this issue Jul 5, 2023
Overview

  This release introduces exclude_null support.

New features
  - Added exclude_null support for indexes (#110).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1sp bug Something isn't working teamE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants