Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: [BUG] in mysql-protocol 0.9.9

From: dockimbel:free at: 29-Jul-2003 14:58

Hi rebOldes, Selon rebOldes <[rebol-list2--seznam--cz]>:
> Hello doc, > just want to tell you that you are using variable 'byte in the global > context in your mysql-protocol.r version 0.9.9! > > FIX: > change line in "data reading" from: > b0: b1: b2: b3: int: int24: long: string: field: len: none > > to: > b0: b1: b2: b3: int: int24: byte: long: string: field: len: none >
I would hardly call that a bug and I don't think it deserves a [BUG] banner, but anyway, thanks for the report. I guess you had a hard time finding the guilty source code. ;-)
> PS: > I'm now experimenting with running the protocol as an asyn.port so
Good idea !
> I would like to now what's the best way how to deal with the data. > IS it better to process only one row result in time when port's > awake or is it better to process for example 10 or more rows at
It depends on the level of granularity you want to achieve. If you want to multiplex several I/O tasks you'll have better results with small processing in the awake handler. The MySQL driver engine was designed to read and process logical data packets (my pgsql driver works on physical (tcp) packets with greater performance), so you have to let it, at least, decode a complete row. I would do only one row by awake events. The best way would be te recode the driver to make it async by design.
> this time? And if there is any support in the handler how to detect > if the port is still busy (so I should not send any other commands > to the db port since all data from previous sql command are > processed)?
Yes, port/local/stream-end?. If 'false, then the driver is expecting data to come. You can cancel a pending command by reading at low-level all incoming data and trashing it. See 'flush-pending-data function. HTH, -DocKimbel