Skip to content

Commit

Permalink
Remove reference to undeclared variable TypeConverters. Resolves phar…
Browse files Browse the repository at this point in the history
  • Loading branch information
rko281 committed May 3, 2024
1 parent 5d3cacd commit f550c39
Show file tree
Hide file tree
Showing 50 changed files with 680 additions and 602 deletions.
4 changes: 2 additions & 2 deletions MySQL-Core/DateAndTime.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #DateAndTime }
Extension { #name : 'DateAndTime' }

{ #category : #'*MySQL-Core' }
{ #category : '*MySQL-Core' }
DateAndTime >> asISOString [
^ String streamContents: [ :aStream |
self printYMDOn: aStream.
Expand Down
14 changes: 8 additions & 6 deletions MySQL-Core/MySQL323Scramble.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,30 @@
323 scramble packet for MySQL
"
Class {
#name : #MySQL323Scramble,
#superclass : #MySQLPacket,
#name : 'MySQL323Scramble',
#superclass : 'MySQLPacket',
#instVars : [
'scrambleBuff',
'password'
],
#category : #'MySQL-Core-Packet'
#category : 'MySQL-Core-Packet',
#package : 'MySQL-Core',
#tag : 'Packet'
}

{ #category : #accessing }
{ #category : 'accessing' }
MySQL323Scramble >> password: pwd [
password := pwd

]

{ #category : #accessing }
{ #category : 'accessing' }
MySQL323Scramble >> scrambleBuff: scramble [
scrambleBuff := scramble

]

{ #category : #writing }
{ #category : 'writing' }
MySQL323Scramble >> write [
| scrmbl buffStream |
buffStream := WriteStream on: (ByteArray new: 256).
Expand Down
40 changes: 21 additions & 19 deletions MySQL-Core/MySQLBinaryReader.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,30 @@
Binary reader for MySQL
"
Class {
#name : #MySQLBinaryReader,
#superclass : #Object,
#name : 'MySQLBinaryReader',
#superclass : 'Object',
#classInstVars : [
'defaultInstance'
],
#category : #'MySQL-Core-Utilities'
#category : 'MySQL-Core-Utilities',
#package : 'MySQL-Core',
#tag : 'Utilities'
}

{ #category : #'as yet unclassified' }
{ #category : 'as yet unclassified' }
MySQLBinaryReader class >> default [
defaultInstance isNil ifTrue: [ defaultInstance := self new ].
^ defaultInstance
]

{ #category : #integer }
{ #category : 'integer' }
MySQLBinaryReader >> bigIntFrom: aStream [
^ aStream next + (aStream next << 8) + (aStream next << 16) + (aStream next << 24) +
(aStream next << 32) + (aStream next << 40) + (aStream next << 48) + (aStream next << 56)

]

{ #category : #time }
{ #category : 'time' }
MySQLBinaryReader >> dateFrom: aStream [ "ByteStream"
"Ref: libmysql.c >> read_binary_date"
| len year month day |
Expand All @@ -41,7 +43,7 @@ MySQLBinaryReader >> dateFrom: aStream [ "ByteStream"

]

{ #category : #time }
{ #category : 'time' }
MySQLBinaryReader >> dateTimeFrom: aStream [ "ByteStream"
"Ref: libmysql.c >> read_binary_datetime"
"length(1) + year(2) + month(1) + day(1) + hh(1) + mm(1) + ss(1) + micoSeconds(4)"
Expand All @@ -68,15 +70,15 @@ MySQLBinaryReader >> dateTimeFrom: aStream [ "ByteStream"

]

{ #category : #real }
{ #category : 'real' }
MySQLBinaryReader >> decimalWithScale: scale from: aStream [
| valueString |
valueString := (MySQLHelper decodeLcsFrom: aStream) asString, 's', scale asString.
^ valueString asNumber

]

{ #category : #real }
{ #category : 'real' }
MySQLBinaryReader >> doubleFrom: aStream [
| num |
num := Float new: 2.
Expand All @@ -87,33 +89,33 @@ MySQLBinaryReader >> doubleFrom: aStream [

]

{ #category : #real }
{ #category : 'real' }
MySQLBinaryReader >> floatFrom: aStream [
^ Float fromIEEE32Bit: (self longIntFrom: aStream)

]

{ #category : #integer }
{ #category : 'integer' }
MySQLBinaryReader >> longIntFrom: aStream [
^ aStream next + (aStream next << 8) + (aStream next << 16) + (aStream next << 24)

]

{ #category : #integer }
{ #category : 'integer' }
MySQLBinaryReader >> mediumIntFrom: aStream [
"int24 is sent as 4 bytes int"
"Ref: libmysql.c >> fetch_result_with_conversion()"
^ self longIntFrom: aStream

]

{ #category : #integer }
{ #category : 'integer' }
MySQLBinaryReader >> smallIntFrom: aStream [
^ aStream next + (aStream next << 8)

]

{ #category : #time }
{ #category : 'time' }
MySQLBinaryReader >> timeFrom: aStream [
"ByteStream"
"length(1) + sign(1) + days(4) + hh(1) + mm(1) + ss(1) + subSeconds(4)"
Expand Down Expand Up @@ -148,33 +150,33 @@ MySQLBinaryReader >> timeFrom: aStream [
ifFalse: [ ^ timeOfDay ]
]

{ #category : #time }
{ #category : 'time' }
MySQLBinaryReader >> timeStampFrom: aStream [ "ByteStream"
^ self dateTimeFrom: aStream.

]

{ #category : #integer }
{ #category : 'integer' }
MySQLBinaryReader >> tinyIntFrom: aStream [
^ aStream next

]

{ #category : #blob }
{ #category : 'blob' }
MySQLBinaryReader >> varBlobFrom: aStream [
^ MySQLHelper decodeLcsFrom: aStream


]

{ #category : #string }
{ #category : 'string' }
MySQLBinaryReader >> varStringFrom: aStream [
^ (self varBlobFrom: aStream) asString


]

{ #category : #time }
{ #category : 'time' }
MySQLBinaryReader >> yearFrom: aStream [ "ByteStream"
^ self smallIntFrom: aStream

Expand Down
24 changes: 13 additions & 11 deletions MySQL-Core/MySQLBinaryRowData.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@
Common superclass for MySQL binary row data
"
Class {
#name : #MySQLBinaryRowData,
#superclass : #MySQLRowData,
#name : 'MySQLBinaryRowData',
#superclass : 'MySQLRowData',
#instVars : [
'header',
'nullBitMap',
'columnDescriptors',
'columnValues'
],
#category : #'MySQL-Core-Packet-RowData'
#category : 'MySQL-Core-Packet-RowData',
#package : 'MySQL-Core',
#tag : 'Packet-RowData'
}

{ #category : #accessing }
{ #category : 'accessing' }
MySQLBinaryRowData >> atIndex: indx [
^ columnValues at: indx ifAbsent: [MySQLInvalidRowAccess signal: 'No data at this index']

]

{ #category : #accessing }
{ #category : 'accessing' }
MySQLBinaryRowData >> columnDescriptors: fieldList [
columnDescriptors := fieldList

]

{ #category : #enumerating }
{ #category : 'enumerating' }
MySQLBinaryRowData >> do: aBlock [
^columnValues do: aBlock
]

{ #category : #testing }
{ #category : 'testing' }
MySQLBinaryRowData >> isColumnNullAt: index [
| byteIndex bitsToShift bitMask |
byteIndex := index + 9 // 8.
Expand All @@ -42,18 +44,18 @@ MySQLBinaryRowData >> isColumnNullAt: index [

]

{ #category : #accessing }
{ #category : 'accessing' }
MySQLBinaryRowData >> last [
^ self atIndex: (columnValues size)
]

{ #category : #accessing }
{ #category : 'accessing' }
MySQLBinaryRowData >> nullBitMap: byteArray [ "primarily for testing"
nullBitMap := byteArray

]

{ #category : #parsing }
{ #category : 'parsing' }
MySQLBinaryRowData >> parse [
| col |
header := inStream next. "always 0"
Expand All @@ -72,7 +74,7 @@ MySQLBinaryRowData >> parse [
put: col ]
]

{ #category : #reading }
{ #category : 'reading' }
MySQLBinaryRowData >> readColumnFrom: aStream perDescrption: columnDescr [
| reader value mask |

Expand Down
8 changes: 5 additions & 3 deletions MySQL-Core/MySQLBindError.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
Binding error for MySQL
"
Class {
#name : #MySQLBindError,
#superclass : #MySQLDriverError,
#category : #'MySQL-Core-Exception'
#name : 'MySQLBindError',
#superclass : 'MySQLDriverError',
#category : 'MySQL-Core-Exception',
#package : 'MySQL-Core',
#tag : 'Exception'
}
Loading

0 comments on commit f550c39

Please sign in to comment.