Random error while 'SELECT', PostgreSQL v17.11-3, Zebra MC3401, Android 14, Visual Studio 2022, C#, .Net9.0, Ngpsql 8.0.9, Npgsql 9.0.5, Npgsql 10.0.3

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

Mantenedores costumam responder em até 6 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
42/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
csharp, postgresql
Domínio
database

Direção de pesquisa

Start by checking whether the repeated SELECT and its returned column types are consistent across runs; the issue does not include the SQL, schema, or a reproducible test, so request those details before tracing Npgsql’s read path. Compare behavior on the failing Android 14 device with the working Android 8.1 device. Done means identifying a reproducible cause or obtaining enough information to narrow it down.

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

Descrição

if I call the same SQL 10 times, 2 times it is executed OK and 8 times it is executed with a random error.

C# code from Android application:

System.Data.DataTable DT;
DT = new DataTable();

NpgsqlCommand pgCommand = new NpgsqlCommand( SQL, pgConnection );
NpgsqlDataAdapter pgDataAdapter = new NpgsqlDataAdapter( pgCommand );

try
{
  // with the same query (same SQL) - this will cause a random error (see below) or execution without error
  pgDataAdapter.Fill( DT ); 
}
catch (PostgresException PE)
{
  ...
}
catch (Exception E)
{
  // random error
}

The query is executed after pressing a button in the application.
This is the result:

  1. SELECT: OK
  2. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 2, len: 536870915)
  3. SELECT: OK
  4. EXCEPTION: Index and count must refer to a location within the buffer. (Parameter 'bytes')
  5. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 4, len: 131092)
  6. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 4, len: 1028)
  7. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 2, len: 2050)
  8. EXCEPTION: Unable to translate bytes [B0] at index 3 from specified code page to Unicode.
  9. EXCEPTION: Exception while reading form stream
  10. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 8, len: 2097160)
  11. SELECT: OK
  12. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 8, len: 65544)
  13. EXCEPTION: The read on this field has not consumed all of its bytes (pos: 4, len: 260)
  14. EXCEPTION: Reading as 'System.Object' is not supported for fields having DataTypeName '-.-'
  15. EXCEPTION: The read on this field has consumed all of its bytes and read into the subsequent bytes (pos: 4, len: -16843010)
  16. SELECT: OK
  17. FREEZE. (RESTART APPLICATION)
  18. EXCEPTION ....
  19. ....

SAME APPLICATION ON ZEBRA MC3300, Android v8.1 WORKS WITHOUT ANY EXCEPTION.

'SELECT' WORKS FINE ON PSQL.
NO ERRORS IN POSTGRESQL LOG.

Linguagem predominante
C#
Estrelas
3.7k
Forks
890
Merge médio
4d 11h
PRs com merge (30d)
19

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

  • Sem Dockerfile nem arquivo Docker Compose
  • Sem modelo de pull request
  • Sem guia de contribuição

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 npgsql/npgsql

Todas as issues de npgsql/npgsql

Issues semelhantes

Mais issues de C#

Receba novas issues na sua caixa de entrada

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