Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Implement Handling for Insertions into Views in YSQLSchema

Aberta
#1,158 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
35/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
java, sql
Domínio
databases

Direção de pesquisa

Comece na classe YSQLSchema, no método que recupera as informações das tabelas, usando as colunas table_type e is_insertable_into de information_schema como contexto relevante. Adicione testes que cubram a identificação de views e a possibilidade de inserção; em seguida, verifique o comportamento dos testes de banco de dados YSQL e atualize a documentação, se necessário.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

The YSQLSchema class in the SQLancer repository currently has a TODO comment indicating that the functionality for handling insertions into views is not fully implemented. This enhancement will ensure that views are correctly identified and their insertability is accurately determined, improving the robustness of the YSQL database testing framework.

Current Code Context

In the YSQLSchema class, the method responsible for retrieving table information includes a TODO comment related to views:

while (rs.next()) {
                        String tableName = rs.getString("table_name");
                        String tableTypeSchema = rs.getString("table_schema");
                        boolean isInsertable = rs.getBoolean("is_insertable_into");
                        // TODO: also check insertable
                        // TODO: insert into view?
                        boolean isView = tableName.startsWith("v"); // tableTypeStr.contains("VIEW") ||
                        // tableTypeStr.contains("LOCAL TEMPORARY") &&
                        // !isInsertable;
                        YSQLTable.TableType tableType = getTableType(tableTypeSchema);
                        List<YSQLColumn> databaseColumns = getTableColumns(con, tableName);
                        List<YSQLIndex> indexes = getIndexes(con, tableName);
                        List<YSQLStatisticsObject> statistics = getStatistics(con);
                        YSQLTable t = new YSQLTable(tableName, databaseColumns, indexes, tableType, statistics, isView,
                                isInsertable);
                        for (YSQLColumn c : databaseColumns) {
                            c.setTable(t);
                        }
                        databaseTables.add(t);
What I'll changes
  • Identify Views Properly: Use the table_type column from information_schema.tables to accurately determine if a table is a view.
  • Check Insertability: Utilize the is_insertable_into column to determine if a view can be inserted into.

what I'll do

  • Implement the changes in the YSQLSchema class.
  • Add unit tests to verify the correct identification and handling of views.
  • Update documentation to reflect these changes.

Please let me know if you need further clarification.

Linguagem predominante
Java
Estrelas
1.8k
Forks
398
Merge médio
4h 52min
PRs com merge (30d)
3

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de sqlancer/sqlancer

Todas as issues de sqlancer/sqlancer

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.