# File lib/dbd/mysql/database.rb, line 315
315:         def mysql_type_info(typedef)
316:             sqltype, type, size, decimal = nil, nil, nil, nil
317: 
318:             pos = typedef.index('(')
319:             if not pos.nil?
320:                 type = typedef[0..pos-1]
321:                 size = typedef[pos+1..-2]
322:                 pos = size.index(',')
323:                 if not pos.nil?
324:                     size, decimal = size.split(',', 2)
325:                     decimal = decimal.to_i
326:                 end
327:                 size = size.to_i
328:             else
329:                 type = typedef
330:             end
331: 
332:             type_info = MYSQL_to_XOPEN[type.upcase] || MYSQL_to_XOPEN[nil]
333:             sqltype = type_info[0]
334:             if size.nil? then size = type_info[1] end
335:             if decimal.nil? then decimal = type_info[2] end
336:             return sqltype, type, size, decimal
337:         end