- 2026-05-29 1.1.18 Corrección rutina LeeMysql y LeeMysqlBytArray para que como maximo se admitan 2048 caracteres string

This commit is contained in:
2026-06-01 11:20:27 +02:00
parent 5c286f48de
commit c7851c5d98
2 changed files with 12 additions and 8 deletions

17
bbdd.vb
View File

@@ -4,6 +4,7 @@ Imports System.Data.Common
Imports System.Data.SqlClient
Imports System.Globalization
Imports System.IO
Imports tsUtilidades.Extensiones
Public Class bbdd
Public Shared Function EjeMySqlHex(BD As DbConnection, sqlh As String) As String
Try
@@ -85,7 +86,7 @@ Public Class bbdd
Tipo = "N"
Tamaño = 20
End Select
If Tamaño <= 1024 Then
If Tamaño <= 2048 Then
sLinea &= dc.ColumnName & "(" & Tipo & iInicioBuffer.ToString & ";" & Tamaño.ToString & ")|"
iInicioBuffer += Tamaño
End If
@@ -96,10 +97,11 @@ Public Class bbdd
For Each dc In dt.Columns
Select Case dc.DataType
Case GetType(String)
Dim tam = System.Math.Min(2048, dc.MaxLength)
If Not dr(dc) Is DBNull.Value Then
sLinea &= dr(dc).ToString.PadRight(dc.MaxLength, " ")
sLinea &= dr(dc).ToString.Acortar(tam).PadRight(tam, " ")
Else
sLinea &= "".PadRight(System.Math.Min(2048, dc.MaxLength), " ")
sLinea &= "".PadRight(tam, " ")
End If
Case GetType(DateTime), GetType(Date)
Dim sFecha As String = "null"
@@ -151,7 +153,7 @@ Public Class bbdd
Select Case dc.DataType
Case GetType(String)
Tipo = "X"
Tamaño = dc.MaxLength
Tamaño = System.Math.Min(2048, dc.MaxLength)
Case GetType(DateTime), GetType(Date)
Tipo = "F"
Tamaño = 20
@@ -159,7 +161,7 @@ Public Class bbdd
Tipo = "N"
Tamaño = 20
End Select
If Tamaño <= 1024 Then
If Tamaño <= 2048 Then
sLinea &= dc.ColumnName & "(" & Tipo & iInicioBuffer.ToString & ";" & Tamaño.ToString & ")|"
iInicioBuffer += Tamaño
End If
@@ -170,10 +172,11 @@ Public Class bbdd
For Each dc In dt.Columns
Select Case dc.DataType
Case GetType(String)
Dim tam = System.Math.Min(2048, dc.MaxLength)
If Not dr(dc) Is DBNull.Value Then
sLinea &= dr(dc).ToString.PadRight(dc.MaxLength, " ")
sLinea &= dr(dc).ToString.Acortar(tam).PadRight(tam, " ")
Else
sLinea &= "".PadRight(dc.MaxLength, " ")
sLinea &= "".PadRight(tam, " ")
End If
Case GetType(DateTime), GetType(Date)
Dim sFecha As String = "null"