og 0.20.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +796 -664
- data/INSTALL +24 -24
- data/README +39 -32
- data/Rakefile +41 -42
- data/benchmark/bench.rb +36 -36
- data/doc/AUTHORS +15 -12
- data/doc/LICENSE +3 -3
- data/doc/RELEASES +311 -243
- data/doc/config.txt +1 -1
- data/examples/mysql_to_psql.rb +15 -15
- data/examples/run.rb +92 -92
- data/install.rb +7 -17
- data/lib/og.rb +76 -75
- data/lib/og/collection.rb +203 -160
- data/lib/og/entity.rb +168 -169
- data/lib/og/errors.rb +5 -5
- data/lib/og/manager.rb +179 -178
- data/lib/og/mixin/hierarchical.rb +107 -107
- data/lib/og/mixin/optimistic_locking.rb +36 -36
- data/lib/og/mixin/orderable.rb +148 -148
- data/lib/og/mixin/timestamped.rb +8 -8
- data/lib/og/mixin/tree.rb +124 -124
- data/lib/og/relation.rb +237 -213
- data/lib/og/relation/belongs_to.rb +5 -5
- data/lib/og/relation/has_many.rb +60 -58
- data/lib/og/relation/joins_many.rb +93 -47
- data/lib/og/relation/refers_to.rb +25 -21
- data/lib/og/store.rb +210 -207
- data/lib/og/store/filesys.rb +79 -79
- data/lib/og/store/kirby.rb +263 -258
- data/lib/og/store/memory.rb +261 -261
- data/lib/og/store/mysql.rb +288 -284
- data/lib/og/store/psql.rb +261 -244
- data/lib/og/store/sql.rb +873 -720
- data/lib/og/store/sqlite.rb +177 -175
- data/lib/og/store/sqlserver.rb +204 -214
- data/lib/og/types.rb +1 -1
- data/lib/og/validation.rb +57 -57
- data/lib/vendor/mysql.rb +376 -376
- data/lib/vendor/mysql411.rb +10 -10
- data/test/og/mixin/tc_hierarchical.rb +59 -59
- data/test/og/mixin/tc_optimistic_locking.rb +40 -40
- data/test/og/mixin/tc_orderable.rb +67 -67
- data/test/og/mixin/tc_timestamped.rb +19 -19
- data/test/og/store/tc_filesys.rb +46 -46
- data/test/og/tc_inheritance.rb +81 -81
- data/test/og/tc_join.rb +67 -0
- data/test/og/tc_polymorphic.rb +49 -49
- data/test/og/tc_relation.rb +57 -30
- data/test/og/tc_select.rb +49 -0
- data/test/og/tc_store.rb +345 -337
- data/test/og/tc_types.rb +11 -11
- metadata +11 -18
data/lib/og/types.rb
CHANGED
data/lib/og/validation.rb
CHANGED
@@ -7,71 +7,71 @@ module Glue
|
|
7
7
|
|
8
8
|
module Validation
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
# Encapsulates a list of validation errors.
|
11
|
+
|
12
|
+
class Errors
|
13
|
+
cattr_accessor :not_unique, 'The value is already used'
|
14
|
+
cattr_accessor :invalid_relation, 'Invalid relations'
|
15
|
+
end
|
16
16
|
|
17
|
-
|
17
|
+
module MetaLanguage
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
19
|
+
# Validate the value of this attribute is unique
|
20
|
+
# for this class.
|
21
|
+
#
|
22
|
+
# The Og libraries are required for this methdod to
|
23
|
+
# work. You can override this method if you want to
|
24
|
+
# use another OR mapping library.
|
25
|
+
#
|
26
|
+
#--
|
27
|
+
# TODO: :unique should implicitly generate
|
28
|
+
# validate_unique.
|
29
|
+
#++
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
31
|
+
def validate_unique(*params)
|
32
|
+
c = {
|
33
|
+
:msg => Glue::Validation::Errors.not_unique,
|
34
|
+
:on => :save
|
35
|
+
}
|
36
|
+
c.update(params.pop) if params.last.is_a?(Hash)
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
38
|
+
for name in params
|
39
|
+
# FIXME: improve the generated code.
|
40
|
+
code = %{
|
41
|
+
others = obj.class.find_by_#{name}(obj.#{name})
|
42
|
+
unless (others.is_a?(Array) and others.empty?)
|
43
|
+
errors.add(:#{name}, '#{c[:msg]}')
|
44
|
+
end;
|
45
|
+
}
|
46
46
|
|
47
|
-
|
48
|
-
|
49
|
-
|
47
|
+
__meta[:validations] << [code, c[:on]]
|
48
|
+
end
|
49
|
+
end
|
50
50
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
51
|
+
# Validate the related object or objects. Works
|
52
|
+
# with all relations.
|
53
|
+
|
54
|
+
def validate_related(*params)
|
55
|
+
c = {
|
56
|
+
:msg => Glue::Validation::Errors.invalid_relation,
|
57
|
+
:on => :save
|
58
|
+
}
|
59
|
+
c.update(params.pop) if params.last.is_a?(Hash)
|
60
|
+
|
61
|
+
for name in params
|
62
|
+
code = %{
|
63
|
+
unless (obj.#{name}.is_a?(Array) ? obj.#{name} : [obj.#{name}]).inject(true) { |memo, obj| (obj.nil? or obj.valid?) and memo }
|
64
|
+
errors.add(:#{name}, '#{c[:msg]}')
|
65
|
+
end;
|
66
|
+
}
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
__meta[:validations] << [code, c[:on]]
|
69
|
+
end
|
70
|
+
end
|
71
|
+
alias_method :validate_associated, :validate_related
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
end
|
74
|
+
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
data/lib/vendor/mysql.rb
CHANGED
@@ -18,69 +18,69 @@ class Mysql
|
|
18
18
|
PROTOCOL_VERSION = 10
|
19
19
|
|
20
20
|
# Command
|
21
|
-
COM_SLEEP
|
22
|
-
COM_QUIT
|
23
|
-
COM_INIT_DB
|
24
|
-
COM_QUERY
|
25
|
-
COM_FIELD_LIST
|
26
|
-
COM_CREATE_DB
|
27
|
-
COM_DROP_DB
|
28
|
-
COM_REFRESH
|
29
|
-
COM_SHUTDOWN
|
30
|
-
COM_STATISTICS
|
31
|
-
COM_PROCESS_INFO
|
32
|
-
COM_CONNECT
|
33
|
-
COM_PROCESS_KILL
|
34
|
-
COM_DEBUG
|
35
|
-
COM_PING
|
36
|
-
COM_TIME
|
37
|
-
COM_DELAYED_INSERT
|
38
|
-
COM_CHANGE_USER
|
39
|
-
COM_BINLOG_DUMP
|
40
|
-
COM_TABLE_DUMP
|
41
|
-
COM_CONNECT_OUT
|
42
|
-
COM_REGISTER_SLAVE
|
21
|
+
COM_SLEEP = 0
|
22
|
+
COM_QUIT = 1
|
23
|
+
COM_INIT_DB = 2
|
24
|
+
COM_QUERY = 3
|
25
|
+
COM_FIELD_LIST = 4
|
26
|
+
COM_CREATE_DB = 5
|
27
|
+
COM_DROP_DB = 6
|
28
|
+
COM_REFRESH = 7
|
29
|
+
COM_SHUTDOWN = 8
|
30
|
+
COM_STATISTICS = 9
|
31
|
+
COM_PROCESS_INFO = 10
|
32
|
+
COM_CONNECT = 11
|
33
|
+
COM_PROCESS_KILL = 12
|
34
|
+
COM_DEBUG = 13
|
35
|
+
COM_PING = 14
|
36
|
+
COM_TIME = 15
|
37
|
+
COM_DELAYED_INSERT = 16
|
38
|
+
COM_CHANGE_USER = 17
|
39
|
+
COM_BINLOG_DUMP = 18
|
40
|
+
COM_TABLE_DUMP = 19
|
41
|
+
COM_CONNECT_OUT = 20
|
42
|
+
COM_REGISTER_SLAVE = 21
|
43
43
|
|
44
44
|
# Client flag
|
45
|
-
CLIENT_LONG_PASSWORD
|
46
|
-
CLIENT_FOUND_ROWS
|
47
|
-
CLIENT_LONG_FLAG
|
45
|
+
CLIENT_LONG_PASSWORD = 1
|
46
|
+
CLIENT_FOUND_ROWS = 1 << 1
|
47
|
+
CLIENT_LONG_FLAG = 1 << 2
|
48
48
|
CLIENT_CONNECT_WITH_DB= 1 << 3
|
49
|
-
CLIENT_NO_SCHEMA
|
50
|
-
CLIENT_COMPRESS
|
51
|
-
CLIENT_ODBC
|
52
|
-
CLIENT_LOCAL_FILES
|
53
|
-
CLIENT_IGNORE_SPACE
|
54
|
-
CLIENT_INTERACTIVE
|
55
|
-
CLIENT_SSL
|
56
|
-
CLIENT_IGNORE_SIGPIPE
|
57
|
-
CLIENT_TRANSACTIONS
|
49
|
+
CLIENT_NO_SCHEMA = 1 << 4
|
50
|
+
CLIENT_COMPRESS = 1 << 5
|
51
|
+
CLIENT_ODBC = 1 << 6
|
52
|
+
CLIENT_LOCAL_FILES = 1 << 7
|
53
|
+
CLIENT_IGNORE_SPACE = 1 << 8
|
54
|
+
CLIENT_INTERACTIVE = 1 << 10
|
55
|
+
CLIENT_SSL = 1 << 11
|
56
|
+
CLIENT_IGNORE_SIGPIPE = 1 << 12
|
57
|
+
CLIENT_TRANSACTIONS = 1 << 13
|
58
58
|
CLIENT_CAPABILITIES = CLIENT_LONG_PASSWORD|CLIENT_LONG_FLAG|CLIENT_TRANSACTIONS
|
59
59
|
|
60
60
|
# Connection Option
|
61
|
-
OPT_CONNECT_TIMEOUT
|
62
|
-
OPT_COMPRESS
|
63
|
-
OPT_NAMED_PIPE
|
64
|
-
INIT_COMMAND
|
65
|
-
READ_DEFAULT_FILE
|
66
|
-
READ_DEFAULT_GROUP
|
67
|
-
SET_CHARSET_DIR
|
68
|
-
SET_CHARSET_NAME
|
69
|
-
OPT_LOCAL_INFILE
|
61
|
+
OPT_CONNECT_TIMEOUT = 0
|
62
|
+
OPT_COMPRESS = 1
|
63
|
+
OPT_NAMED_PIPE = 2
|
64
|
+
INIT_COMMAND = 3
|
65
|
+
READ_DEFAULT_FILE = 4
|
66
|
+
READ_DEFAULT_GROUP = 5
|
67
|
+
SET_CHARSET_DIR = 6
|
68
|
+
SET_CHARSET_NAME = 7
|
69
|
+
OPT_LOCAL_INFILE = 8
|
70
70
|
|
71
71
|
# Server Status
|
72
|
-
SERVER_STATUS_IN_TRANS
|
73
|
-
SERVER_STATUS_AUTOCOMMIT
|
72
|
+
SERVER_STATUS_IN_TRANS = 1
|
73
|
+
SERVER_STATUS_AUTOCOMMIT = 2
|
74
74
|
|
75
75
|
# Refresh parameter
|
76
|
-
REFRESH_GRANT
|
77
|
-
REFRESH_LOG
|
78
|
-
REFRESH_TABLES
|
79
|
-
REFRESH_HOSTS
|
80
|
-
REFRESH_STATUS
|
81
|
-
REFRESH_THREADS
|
82
|
-
REFRESH_SLAVE
|
83
|
-
REFRESH_MASTER
|
76
|
+
REFRESH_GRANT = 1
|
77
|
+
REFRESH_LOG = 2
|
78
|
+
REFRESH_TABLES = 4
|
79
|
+
REFRESH_HOSTS = 8
|
80
|
+
REFRESH_STATUS = 16
|
81
|
+
REFRESH_THREADS = 32
|
82
|
+
REFRESH_SLAVE = 64
|
83
|
+
REFRESH_MASTER = 128
|
84
84
|
|
85
85
|
def initialize(*args)
|
86
86
|
@client_flag = 0
|
@@ -145,9 +145,9 @@ class Mysql
|
|
145
145
|
def options(option, arg=nil)
|
146
146
|
if option == OPT_LOCAL_INFILE then
|
147
147
|
if arg == false or arg == 0 then
|
148
|
-
|
148
|
+
@client_flag &= ~CLIENT_LOCAL_FILES
|
149
149
|
else
|
150
|
-
|
150
|
+
@client_flag |= CLIENT_LOCAL_FILES
|
151
151
|
end
|
152
152
|
else
|
153
153
|
raise "not implemented"
|
@@ -316,9 +316,9 @@ class Mysql
|
|
316
316
|
field_count.times do
|
317
317
|
len = get_length data
|
318
318
|
if len == nil then
|
319
|
-
|
319
|
+
rec << len
|
320
320
|
else
|
321
|
-
|
321
|
+
rec << data.slice!(0,len)
|
322
322
|
end
|
323
323
|
end
|
324
324
|
rec
|
@@ -327,8 +327,8 @@ class Mysql
|
|
327
327
|
def skip_result()
|
328
328
|
if @status == :STATUS_USE_RESULT then
|
329
329
|
loop do
|
330
|
-
|
331
|
-
|
330
|
+
data = read
|
331
|
+
break if data[0] == 254 and data.length == 1
|
332
332
|
end
|
333
333
|
@status = :STATUS_READY
|
334
334
|
end
|
@@ -343,11 +343,11 @@ class Mysql
|
|
343
343
|
def read_query_result()
|
344
344
|
data = read
|
345
345
|
@field_count = get_length(data)
|
346
|
-
if @field_count == nil then
|
346
|
+
if @field_count == nil then # LOAD DATA LOCAL INFILE
|
347
347
|
File::open(data) do |f|
|
348
|
-
|
348
|
+
write f.read
|
349
349
|
end
|
350
|
-
write ""
|
350
|
+
write "" # mark EOF
|
351
351
|
data = read
|
352
352
|
@field_count = get_length(data)
|
353
353
|
end
|
@@ -355,11 +355,11 @@ class Mysql
|
|
355
355
|
@affected_rows = get_length(data, true)
|
356
356
|
@insert_id = get_length(data, true)
|
357
357
|
if @server_capabilities & CLIENT_TRANSACTIONS != 0 then
|
358
|
-
|
359
|
-
|
358
|
+
a = data.slice!(0,2)
|
359
|
+
@server_status = a[0]+a[1]*256
|
360
360
|
end
|
361
361
|
if data.size > 0 and get_length(data) then
|
362
|
-
|
362
|
+
@info = data
|
363
363
|
end
|
364
364
|
else
|
365
365
|
@extra_info = get_length(data, true)
|
@@ -378,11 +378,11 @@ class Mysql
|
|
378
378
|
length = f[2][0]+f[2][1]*256+f[2][2]*256*256
|
379
379
|
type = f[3][0]
|
380
380
|
if long_flag_protocol then
|
381
|
-
|
382
|
-
|
381
|
+
flags = f[4][0]+f[4][1]*256
|
382
|
+
decimals = f[4][2]
|
383
383
|
else
|
384
|
-
|
385
|
-
|
384
|
+
flags = f[4][0]
|
385
|
+
decimals = f[4][1]
|
386
386
|
end
|
387
387
|
def_value = f[5]
|
388
388
|
max_length = 0
|
@@ -414,10 +414,10 @@ class Mysql
|
|
414
414
|
when 254
|
415
415
|
a = data.slice!(0,8)
|
416
416
|
if longlong then
|
417
|
-
|
418
|
-
|
417
|
+
return a[0]+a[1]*256+a[2]*256**2+a[3]*256**3+
|
418
|
+
a[4]*256**4+a[5]*256**5+a[6]*256**6+a[7]*256**7
|
419
419
|
else
|
420
|
-
|
420
|
+
return a[0]+a[1]*256+a[2]*256**2+a[3]*256**3
|
421
421
|
end
|
422
422
|
else
|
423
423
|
c
|
@@ -443,11 +443,11 @@ class Mysql
|
|
443
443
|
a = @net.read
|
444
444
|
if a[0] == 255 then
|
445
445
|
if a.length > 3 then
|
446
|
-
|
447
|
-
|
446
|
+
@errno = a[1]+a[2]*256
|
447
|
+
@error = a[3 .. -1]
|
448
448
|
else
|
449
|
-
|
450
|
-
|
449
|
+
@errno = Error::CR_UNKNOWN_ERROR
|
450
|
+
@error = Error::err @errno
|
451
451
|
end
|
452
452
|
raise Error::new(@errno, @error)
|
453
453
|
end
|
@@ -533,21 +533,21 @@ class Mysql
|
|
533
533
|
|
534
534
|
def fetch_row()
|
535
535
|
if @data then
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
536
|
+
if @current_row >= @data.length then
|
537
|
+
@handle.status = :STATUS_READY
|
538
|
+
return
|
539
|
+
end
|
540
|
+
ret = @data[@current_row]
|
541
|
+
@current_row += 1
|
542
542
|
else
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
543
|
+
return if @eof
|
544
|
+
ret = @handle.read_one_row @field_count
|
545
|
+
if ret == nil then
|
546
|
+
@eof = true
|
547
|
+
return
|
548
|
+
end
|
549
|
+
@lengths = ret.map{|i| i ? i.length : 0}
|
550
|
+
@row_count += 1
|
551
551
|
end
|
552
552
|
ret
|
553
553
|
end
|
@@ -557,8 +557,8 @@ class Mysql
|
|
557
557
|
return if row == nil
|
558
558
|
hash = {}
|
559
559
|
@fields.each_index do |i|
|
560
|
-
|
561
|
-
|
560
|
+
f = with_table ? @fields[i].table+"."+@fields[i].name : @fields[i].name
|
561
|
+
hash[f] = row[i]
|
562
562
|
end
|
563
563
|
hash
|
564
564
|
end
|
@@ -595,13 +595,13 @@ class Mysql
|
|
595
595
|
|
596
596
|
def each()
|
597
597
|
while row = fetch_row do
|
598
|
-
|
598
|
+
yield row
|
599
599
|
end
|
600
600
|
end
|
601
601
|
|
602
602
|
def each_hash(with_table=nil)
|
603
603
|
while hash = fetch_hash(with_table) do
|
604
|
-
|
604
|
+
yield hash
|
605
605
|
end
|
606
606
|
end
|
607
607
|
|
@@ -669,7 +669,7 @@ class Mysql
|
|
669
669
|
@def = def_value
|
670
670
|
@max_length = max_length
|
671
671
|
if (type <= TYPE_INT24 and (type != TYPE_TIMESTAMP or length == 14 or length == 8)) or type == TYPE_YEAR then
|
672
|
-
|
672
|
+
@flags |= NUM_FLAG
|
673
673
|
end
|
674
674
|
end
|
675
675
|
attr_reader :table, :org_table, :name, :length, :type, :flags, :decimals, :def, :max_length
|
@@ -681,277 +681,277 @@ class Mysql
|
|
681
681
|
|
682
682
|
class Error < StandardError
|
683
683
|
# Server Error
|
684
|
-
ER_HASHCHK
|
685
|
-
ER_NISAMCHK
|
686
|
-
ER_NO
|
687
|
-
ER_YES
|
688
|
-
ER_CANT_CREATE_FILE
|
689
|
-
ER_CANT_CREATE_TABLE
|
690
|
-
ER_CANT_CREATE_DB
|
691
|
-
ER_DB_CREATE_EXISTS
|
692
|
-
ER_DB_DROP_EXISTS
|
693
|
-
ER_DB_DROP_DELETE
|
694
|
-
ER_DB_DROP_RMDIR
|
695
|
-
ER_CANT_DELETE_FILE
|
696
|
-
ER_CANT_FIND_SYSTEM_REC
|
697
|
-
ER_CANT_GET_STAT
|
698
|
-
ER_CANT_GET_WD
|
699
|
-
ER_CANT_LOCK
|
700
|
-
ER_CANT_OPEN_FILE
|
701
|
-
ER_FILE_NOT_FOUND
|
702
|
-
ER_CANT_READ_DIR
|
703
|
-
ER_CANT_SET_WD
|
704
|
-
ER_CHECKREAD
|
705
|
-
ER_DISK_FULL
|
706
|
-
ER_DUP_KEY
|
707
|
-
ER_ERROR_ON_CLOSE
|
708
|
-
ER_ERROR_ON_READ
|
709
|
-
ER_ERROR_ON_RENAME
|
710
|
-
ER_ERROR_ON_WRITE
|
711
|
-
ER_FILE_USED
|
712
|
-
ER_FILSORT_ABORT
|
713
|
-
ER_FORM_NOT_FOUND
|
714
|
-
ER_GET_ERRNO
|
715
|
-
ER_ILLEGAL_HA
|
716
|
-
ER_KEY_NOT_FOUND
|
717
|
-
ER_NOT_FORM_FILE
|
718
|
-
ER_NOT_KEYFILE
|
719
|
-
ER_OLD_KEYFILE
|
720
|
-
ER_OPEN_AS_READONLY
|
721
|
-
ER_OUTOFMEMORY
|
722
|
-
ER_OUT_OF_SORTMEMORY
|
723
|
-
ER_UNEXPECTED_EOF
|
724
|
-
ER_CON_COUNT_ERROR
|
725
|
-
ER_OUT_OF_RESOURCES
|
726
|
-
ER_BAD_HOST_ERROR
|
727
|
-
ER_HANDSHAKE_ERROR
|
728
|
-
ER_DBACCESS_DENIED_ERROR
|
729
|
-
ER_ACCESS_DENIED_ERROR
|
730
|
-
ER_NO_DB_ERROR
|
731
|
-
ER_UNKNOWN_COM_ERROR
|
732
|
-
ER_BAD_NULL_ERROR
|
733
|
-
ER_BAD_DB_ERROR
|
734
|
-
ER_TABLE_EXISTS_ERROR
|
735
|
-
ER_BAD_TABLE_ERROR
|
736
|
-
ER_NON_UNIQ_ERROR
|
737
|
-
ER_SERVER_SHUTDOWN
|
738
|
-
ER_BAD_FIELD_ERROR
|
739
|
-
ER_WRONG_FIELD_WITH_GROUP
|
740
|
-
ER_WRONG_GROUP_FIELD
|
741
|
-
ER_WRONG_SUM_SELECT
|
742
|
-
ER_WRONG_VALUE_COUNT
|
743
|
-
ER_TOO_LONG_IDENT
|
744
|
-
ER_DUP_FIELDNAME
|
745
|
-
ER_DUP_KEYNAME
|
746
|
-
ER_DUP_ENTRY
|
747
|
-
ER_WRONG_FIELD_SPEC
|
748
|
-
ER_PARSE_ERROR
|
749
|
-
ER_EMPTY_QUERY
|
750
|
-
ER_NONUNIQ_TABLE
|
751
|
-
ER_INVALID_DEFAULT
|
752
|
-
ER_MULTIPLE_PRI_KEY
|
753
|
-
ER_TOO_MANY_KEYS
|
754
|
-
ER_TOO_MANY_KEY_PARTS
|
755
|
-
ER_TOO_LONG_KEY
|
756
|
-
ER_KEY_COLUMN_DOES_NOT_EXITS
|
757
|
-
ER_BLOB_USED_AS_KEY
|
758
|
-
ER_TOO_BIG_FIELDLENGTH
|
759
|
-
ER_WRONG_AUTO_KEY
|
760
|
-
ER_READY
|
761
|
-
ER_NORMAL_SHUTDOWN
|
762
|
-
ER_GOT_SIGNAL
|
763
|
-
ER_SHUTDOWN_COMPLETE
|
764
|
-
ER_FORCING_CLOSE
|
765
|
-
ER_IPSOCK_ERROR
|
766
|
-
ER_NO_SUCH_INDEX
|
767
|
-
ER_WRONG_FIELD_TERMINATORS
|
768
|
-
ER_BLOBS_AND_NO_TERMINATED
|
769
|
-
ER_TEXTFILE_NOT_READABLE
|
770
|
-
ER_FILE_EXISTS_ERROR
|
771
|
-
ER_LOAD_INFO
|
772
|
-
ER_ALTER_INFO
|
773
|
-
ER_WRONG_SUB_KEY
|
774
|
-
ER_CANT_REMOVE_ALL_FIELDS
|
775
|
-
ER_CANT_DROP_FIELD_OR_KEY
|
776
|
-
ER_INSERT_INFO
|
777
|
-
ER_INSERT_TABLE_USED
|
778
|
-
ER_NO_SUCH_THREAD
|
779
|
-
ER_KILL_DENIED_ERROR
|
780
|
-
ER_NO_TABLES_USED
|
781
|
-
ER_TOO_BIG_SET
|
782
|
-
ER_NO_UNIQUE_LOGFILE
|
783
|
-
ER_TABLE_NOT_LOCKED_FOR_WRITE
|
784
|
-
ER_TABLE_NOT_LOCKED
|
785
|
-
ER_BLOB_CANT_HAVE_DEFAULT
|
786
|
-
ER_WRONG_DB_NAME
|
787
|
-
ER_WRONG_TABLE_NAME
|
788
|
-
ER_TOO_BIG_SELECT
|
789
|
-
ER_UNKNOWN_ERROR
|
790
|
-
ER_UNKNOWN_PROCEDURE
|
791
|
-
ER_WRONG_PARAMCOUNT_TO_PROCEDURE
|
792
|
-
ER_WRONG_PARAMETERS_TO_PROCEDURE
|
793
|
-
ER_UNKNOWN_TABLE
|
794
|
-
ER_FIELD_SPECIFIED_TWICE
|
795
|
-
ER_INVALID_GROUP_FUNC_USE
|
796
|
-
ER_UNSUPPORTED_EXTENSION
|
797
|
-
ER_TABLE_MUST_HAVE_COLUMNS
|
798
|
-
ER_RECORD_FILE_FULL
|
799
|
-
ER_UNKNOWN_CHARACTER_SET
|
800
|
-
ER_TOO_MANY_TABLES
|
801
|
-
ER_TOO_MANY_FIELDS
|
802
|
-
ER_TOO_BIG_ROWSIZE
|
803
|
-
ER_STACK_OVERRUN
|
804
|
-
ER_WRONG_OUTER_JOIN
|
805
|
-
ER_NULL_COLUMN_IN_INDEX
|
806
|
-
ER_CANT_FIND_UDF
|
807
|
-
ER_CANT_INITIALIZE_UDF
|
808
|
-
ER_UDF_NO_PATHS
|
809
|
-
ER_UDF_EXISTS
|
810
|
-
ER_CANT_OPEN_LIBRARY
|
811
|
-
ER_CANT_FIND_DL_ENTRY
|
812
|
-
ER_FUNCTION_NOT_DEFINED
|
813
|
-
ER_HOST_IS_BLOCKED
|
814
|
-
ER_HOST_NOT_PRIVILEGED
|
815
|
-
ER_PASSWORD_ANONYMOUS_USER
|
816
|
-
ER_PASSWORD_NOT_ALLOWED
|
817
|
-
ER_PASSWORD_NO_MATCH
|
818
|
-
ER_UPDATE_INFO
|
819
|
-
ER_CANT_CREATE_THREAD
|
820
|
-
ER_WRONG_VALUE_COUNT_ON_ROW
|
821
|
-
ER_CANT_REOPEN_TABLE
|
822
|
-
ER_INVALID_USE_OF_NULL
|
823
|
-
ER_REGEXP_ERROR
|
824
|
-
ER_MIX_OF_GROUP_FUNC_AND_FIELDS
|
825
|
-
ER_NONEXISTING_GRANT
|
826
|
-
ER_TABLEACCESS_DENIED_ERROR
|
827
|
-
ER_COLUMNACCESS_DENIED_ERROR
|
828
|
-
ER_ILLEGAL_GRANT_FOR_TABLE
|
829
|
-
ER_GRANT_WRONG_HOST_OR_USER
|
830
|
-
ER_NO_SUCH_TABLE
|
831
|
-
ER_NONEXISTING_TABLE_GRANT
|
832
|
-
ER_NOT_ALLOWED_COMMAND
|
833
|
-
ER_SYNTAX_ERROR
|
834
|
-
ER_DELAYED_CANT_CHANGE_LOCK
|
835
|
-
ER_TOO_MANY_DELAYED_THREADS
|
836
|
-
ER_ABORTING_CONNECTION
|
837
|
-
ER_NET_PACKET_TOO_LARGE
|
838
|
-
ER_NET_READ_ERROR_FROM_PIPE
|
839
|
-
ER_NET_FCNTL_ERROR
|
840
|
-
ER_NET_PACKETS_OUT_OF_ORDER
|
841
|
-
ER_NET_UNCOMPRESS_ERROR
|
842
|
-
ER_NET_READ_ERROR
|
843
|
-
ER_NET_READ_INTERRUPTED
|
844
|
-
ER_NET_ERROR_ON_WRITE
|
845
|
-
ER_NET_WRITE_INTERRUPTED
|
846
|
-
ER_TOO_LONG_STRING
|
847
|
-
ER_TABLE_CANT_HANDLE_BLOB
|
848
|
-
ER_TABLE_CANT_HANDLE_AUTO_INCREMENT
|
849
|
-
ER_DELAYED_INSERT_TABLE_LOCKED
|
850
|
-
ER_WRONG_COLUMN_NAME
|
851
|
-
ER_WRONG_KEY_COLUMN
|
852
|
-
ER_WRONG_MRG_TABLE
|
853
|
-
ER_DUP_UNIQUE
|
854
|
-
ER_BLOB_KEY_WITHOUT_LENGTH
|
855
|
-
ER_PRIMARY_CANT_HAVE_NULL
|
856
|
-
ER_TOO_MANY_ROWS
|
857
|
-
ER_REQUIRES_PRIMARY_KEY
|
858
|
-
ER_NO_RAID_COMPILED
|
859
|
-
ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
|
860
|
-
ER_KEY_DOES_NOT_EXITS
|
861
|
-
ER_CHECK_NO_SUCH_TABLE
|
862
|
-
ER_CHECK_NOT_IMPLEMENTED
|
863
|
-
ER_CANT_DO_THIS_DURING_AN_TRANSACTION
|
864
|
-
ER_ERROR_DURING_COMMIT
|
865
|
-
ER_ERROR_DURING_ROLLBACK
|
866
|
-
ER_ERROR_DURING_FLUSH_LOGS
|
867
|
-
ER_ERROR_DURING_CHECKPOINT
|
868
|
-
ER_NEW_ABORTING_CONNECTION
|
869
|
-
ER_DUMP_NOT_IMPLEMENTED
|
870
|
-
ER_FLUSH_MASTER_BINLOG_CLOSED
|
871
|
-
ER_INDEX_REBUILD
|
872
|
-
ER_MASTER
|
873
|
-
ER_MASTER_NET_READ
|
874
|
-
ER_MASTER_NET_WRITE
|
875
|
-
ER_FT_MATCHING_KEY_NOT_FOUND
|
876
|
-
ER_LOCK_OR_ACTIVE_TRANSACTION
|
877
|
-
ER_UNKNOWN_SYSTEM_VARIABLE
|
878
|
-
ER_CRASHED_ON_USAGE
|
879
|
-
ER_CRASHED_ON_REPAIR
|
880
|
-
ER_WARNING_NOT_COMPLETE_ROLLBACK
|
881
|
-
ER_TRANS_CACHE_FULL
|
882
|
-
ER_SLAVE_MUST_STOP
|
883
|
-
ER_SLAVE_NOT_RUNNING
|
884
|
-
ER_BAD_SLAVE
|
885
|
-
ER_MASTER_INFO
|
886
|
-
ER_SLAVE_THREAD
|
887
|
-
ER_TOO_MANY_USER_CONNECTIONS
|
888
|
-
ER_SET_CONSTANTS_ONLY
|
889
|
-
ER_LOCK_WAIT_TIMEOUT
|
890
|
-
ER_LOCK_TABLE_FULL
|
891
|
-
ER_READ_ONLY_TRANSACTION
|
892
|
-
ER_DROP_DB_WITH_READ_LOCK
|
893
|
-
ER_CREATE_DB_WITH_READ_LOCK
|
894
|
-
ER_WRONG_ARGUMENTS
|
895
|
-
ER_NO_PERMISSION_TO_CREATE_USER
|
896
|
-
ER_UNION_TABLES_IN_DIFFERENT_DIR
|
897
|
-
ER_LOCK_DEADLOCK
|
898
|
-
ER_TABLE_CANT_HANDLE_FULLTEXT
|
899
|
-
ER_CANNOT_ADD_FOREIGN
|
900
|
-
ER_NO_REFERENCED_ROW
|
901
|
-
ER_ROW_IS_REFERENCED
|
902
|
-
ER_CONNECT_TO_MASTER
|
903
|
-
ER_QUERY_ON_MASTER
|
904
|
-
ER_ERROR_WHEN_EXECUTING_COMMAND
|
905
|
-
ER_WRONG_USAGE
|
906
|
-
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
|
907
|
-
ER_CANT_UPDATE_WITH_READLOCK
|
908
|
-
ER_MIXING_NOT_ALLOWED
|
909
|
-
ER_DUP_ARGUMENT
|
910
|
-
ER_USER_LIMIT_REACHED
|
911
|
-
ER_SPECIFIC_ACCESS_DENIED_ERROR
|
912
|
-
ER_LOCAL_VARIABLE
|
913
|
-
ER_GLOBAL_VARIABLE
|
914
|
-
ER_NO_DEFAULT
|
915
|
-
ER_WRONG_VALUE_FOR_VAR
|
916
|
-
ER_WRONG_TYPE_FOR_VAR
|
917
|
-
ER_VAR_CANT_BE_READ
|
918
|
-
ER_CANT_USE_OPTION_HERE
|
919
|
-
ER_NOT_SUPPORTED_YET
|
920
|
-
ER_MASTER_FATAL_ERROR_READING_BINLOG
|
921
|
-
ER_SLAVE_IGNORED_TABLE
|
922
|
-
ER_ERROR_MESSAGES
|
684
|
+
ER_HASHCHK = 1000
|
685
|
+
ER_NISAMCHK = 1001
|
686
|
+
ER_NO = 1002
|
687
|
+
ER_YES = 1003
|
688
|
+
ER_CANT_CREATE_FILE = 1004
|
689
|
+
ER_CANT_CREATE_TABLE = 1005
|
690
|
+
ER_CANT_CREATE_DB = 1006
|
691
|
+
ER_DB_CREATE_EXISTS = 1007
|
692
|
+
ER_DB_DROP_EXISTS = 1008
|
693
|
+
ER_DB_DROP_DELETE = 1009
|
694
|
+
ER_DB_DROP_RMDIR = 1010
|
695
|
+
ER_CANT_DELETE_FILE = 1011
|
696
|
+
ER_CANT_FIND_SYSTEM_REC = 1012
|
697
|
+
ER_CANT_GET_STAT = 1013
|
698
|
+
ER_CANT_GET_WD = 1014
|
699
|
+
ER_CANT_LOCK = 1015
|
700
|
+
ER_CANT_OPEN_FILE = 1016
|
701
|
+
ER_FILE_NOT_FOUND = 1017
|
702
|
+
ER_CANT_READ_DIR = 1018
|
703
|
+
ER_CANT_SET_WD = 1019
|
704
|
+
ER_CHECKREAD = 1020
|
705
|
+
ER_DISK_FULL = 1021
|
706
|
+
ER_DUP_KEY = 1022
|
707
|
+
ER_ERROR_ON_CLOSE = 1023
|
708
|
+
ER_ERROR_ON_READ = 1024
|
709
|
+
ER_ERROR_ON_RENAME = 1025
|
710
|
+
ER_ERROR_ON_WRITE = 1026
|
711
|
+
ER_FILE_USED = 1027
|
712
|
+
ER_FILSORT_ABORT = 1028
|
713
|
+
ER_FORM_NOT_FOUND = 1029
|
714
|
+
ER_GET_ERRNO = 1030
|
715
|
+
ER_ILLEGAL_HA = 1031
|
716
|
+
ER_KEY_NOT_FOUND = 1032
|
717
|
+
ER_NOT_FORM_FILE = 1033
|
718
|
+
ER_NOT_KEYFILE = 1034
|
719
|
+
ER_OLD_KEYFILE = 1035
|
720
|
+
ER_OPEN_AS_READONLY = 1036
|
721
|
+
ER_OUTOFMEMORY = 1037
|
722
|
+
ER_OUT_OF_SORTMEMORY = 1038
|
723
|
+
ER_UNEXPECTED_EOF = 1039
|
724
|
+
ER_CON_COUNT_ERROR = 1040
|
725
|
+
ER_OUT_OF_RESOURCES = 1041
|
726
|
+
ER_BAD_HOST_ERROR = 1042
|
727
|
+
ER_HANDSHAKE_ERROR = 1043
|
728
|
+
ER_DBACCESS_DENIED_ERROR = 1044
|
729
|
+
ER_ACCESS_DENIED_ERROR = 1045
|
730
|
+
ER_NO_DB_ERROR = 1046
|
731
|
+
ER_UNKNOWN_COM_ERROR = 1047
|
732
|
+
ER_BAD_NULL_ERROR = 1048
|
733
|
+
ER_BAD_DB_ERROR = 1049
|
734
|
+
ER_TABLE_EXISTS_ERROR = 1050
|
735
|
+
ER_BAD_TABLE_ERROR = 1051
|
736
|
+
ER_NON_UNIQ_ERROR = 1052
|
737
|
+
ER_SERVER_SHUTDOWN = 1053
|
738
|
+
ER_BAD_FIELD_ERROR = 1054
|
739
|
+
ER_WRONG_FIELD_WITH_GROUP = 1055
|
740
|
+
ER_WRONG_GROUP_FIELD = 1056
|
741
|
+
ER_WRONG_SUM_SELECT = 1057
|
742
|
+
ER_WRONG_VALUE_COUNT = 1058
|
743
|
+
ER_TOO_LONG_IDENT = 1059
|
744
|
+
ER_DUP_FIELDNAME = 1060
|
745
|
+
ER_DUP_KEYNAME = 1061
|
746
|
+
ER_DUP_ENTRY = 1062
|
747
|
+
ER_WRONG_FIELD_SPEC = 1063
|
748
|
+
ER_PARSE_ERROR = 1064
|
749
|
+
ER_EMPTY_QUERY = 1065
|
750
|
+
ER_NONUNIQ_TABLE = 1066
|
751
|
+
ER_INVALID_DEFAULT = 1067
|
752
|
+
ER_MULTIPLE_PRI_KEY = 1068
|
753
|
+
ER_TOO_MANY_KEYS = 1069
|
754
|
+
ER_TOO_MANY_KEY_PARTS = 1070
|
755
|
+
ER_TOO_LONG_KEY = 1071
|
756
|
+
ER_KEY_COLUMN_DOES_NOT_EXITS = 1072
|
757
|
+
ER_BLOB_USED_AS_KEY = 1073
|
758
|
+
ER_TOO_BIG_FIELDLENGTH = 1074
|
759
|
+
ER_WRONG_AUTO_KEY = 1075
|
760
|
+
ER_READY = 1076
|
761
|
+
ER_NORMAL_SHUTDOWN = 1077
|
762
|
+
ER_GOT_SIGNAL = 1078
|
763
|
+
ER_SHUTDOWN_COMPLETE = 1079
|
764
|
+
ER_FORCING_CLOSE = 1080
|
765
|
+
ER_IPSOCK_ERROR = 1081
|
766
|
+
ER_NO_SUCH_INDEX = 1082
|
767
|
+
ER_WRONG_FIELD_TERMINATORS = 1083
|
768
|
+
ER_BLOBS_AND_NO_TERMINATED = 1084
|
769
|
+
ER_TEXTFILE_NOT_READABLE = 1085
|
770
|
+
ER_FILE_EXISTS_ERROR = 1086
|
771
|
+
ER_LOAD_INFO = 1087
|
772
|
+
ER_ALTER_INFO = 1088
|
773
|
+
ER_WRONG_SUB_KEY = 1089
|
774
|
+
ER_CANT_REMOVE_ALL_FIELDS = 1090
|
775
|
+
ER_CANT_DROP_FIELD_OR_KEY = 1091
|
776
|
+
ER_INSERT_INFO = 1092
|
777
|
+
ER_INSERT_TABLE_USED = 1093
|
778
|
+
ER_NO_SUCH_THREAD = 1094
|
779
|
+
ER_KILL_DENIED_ERROR = 1095
|
780
|
+
ER_NO_TABLES_USED = 1096
|
781
|
+
ER_TOO_BIG_SET = 1097
|
782
|
+
ER_NO_UNIQUE_LOGFILE = 1098
|
783
|
+
ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099
|
784
|
+
ER_TABLE_NOT_LOCKED = 1100
|
785
|
+
ER_BLOB_CANT_HAVE_DEFAULT = 1101
|
786
|
+
ER_WRONG_DB_NAME = 1102
|
787
|
+
ER_WRONG_TABLE_NAME = 1103
|
788
|
+
ER_TOO_BIG_SELECT = 1104
|
789
|
+
ER_UNKNOWN_ERROR = 1105
|
790
|
+
ER_UNKNOWN_PROCEDURE = 1106
|
791
|
+
ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107
|
792
|
+
ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108
|
793
|
+
ER_UNKNOWN_TABLE = 1109
|
794
|
+
ER_FIELD_SPECIFIED_TWICE = 1110
|
795
|
+
ER_INVALID_GROUP_FUNC_USE = 1111
|
796
|
+
ER_UNSUPPORTED_EXTENSION = 1112
|
797
|
+
ER_TABLE_MUST_HAVE_COLUMNS = 1113
|
798
|
+
ER_RECORD_FILE_FULL = 1114
|
799
|
+
ER_UNKNOWN_CHARACTER_SET = 1115
|
800
|
+
ER_TOO_MANY_TABLES = 1116
|
801
|
+
ER_TOO_MANY_FIELDS = 1117
|
802
|
+
ER_TOO_BIG_ROWSIZE = 1118
|
803
|
+
ER_STACK_OVERRUN = 1119
|
804
|
+
ER_WRONG_OUTER_JOIN = 1120
|
805
|
+
ER_NULL_COLUMN_IN_INDEX = 1121
|
806
|
+
ER_CANT_FIND_UDF = 1122
|
807
|
+
ER_CANT_INITIALIZE_UDF = 1123
|
808
|
+
ER_UDF_NO_PATHS = 1124
|
809
|
+
ER_UDF_EXISTS = 1125
|
810
|
+
ER_CANT_OPEN_LIBRARY = 1126
|
811
|
+
ER_CANT_FIND_DL_ENTRY = 1127
|
812
|
+
ER_FUNCTION_NOT_DEFINED = 1128
|
813
|
+
ER_HOST_IS_BLOCKED = 1129
|
814
|
+
ER_HOST_NOT_PRIVILEGED = 1130
|
815
|
+
ER_PASSWORD_ANONYMOUS_USER = 1131
|
816
|
+
ER_PASSWORD_NOT_ALLOWED = 1132
|
817
|
+
ER_PASSWORD_NO_MATCH = 1133
|
818
|
+
ER_UPDATE_INFO = 1134
|
819
|
+
ER_CANT_CREATE_THREAD = 1135
|
820
|
+
ER_WRONG_VALUE_COUNT_ON_ROW = 1136
|
821
|
+
ER_CANT_REOPEN_TABLE = 1137
|
822
|
+
ER_INVALID_USE_OF_NULL = 1138
|
823
|
+
ER_REGEXP_ERROR = 1139
|
824
|
+
ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140
|
825
|
+
ER_NONEXISTING_GRANT = 1141
|
826
|
+
ER_TABLEACCESS_DENIED_ERROR = 1142
|
827
|
+
ER_COLUMNACCESS_DENIED_ERROR = 1143
|
828
|
+
ER_ILLEGAL_GRANT_FOR_TABLE = 1144
|
829
|
+
ER_GRANT_WRONG_HOST_OR_USER = 1145
|
830
|
+
ER_NO_SUCH_TABLE = 1146
|
831
|
+
ER_NONEXISTING_TABLE_GRANT = 1147
|
832
|
+
ER_NOT_ALLOWED_COMMAND = 1148
|
833
|
+
ER_SYNTAX_ERROR = 1149
|
834
|
+
ER_DELAYED_CANT_CHANGE_LOCK = 1150
|
835
|
+
ER_TOO_MANY_DELAYED_THREADS = 1151
|
836
|
+
ER_ABORTING_CONNECTION = 1152
|
837
|
+
ER_NET_PACKET_TOO_LARGE = 1153
|
838
|
+
ER_NET_READ_ERROR_FROM_PIPE = 1154
|
839
|
+
ER_NET_FCNTL_ERROR = 1155
|
840
|
+
ER_NET_PACKETS_OUT_OF_ORDER = 1156
|
841
|
+
ER_NET_UNCOMPRESS_ERROR = 1157
|
842
|
+
ER_NET_READ_ERROR = 1158
|
843
|
+
ER_NET_READ_INTERRUPTED = 1159
|
844
|
+
ER_NET_ERROR_ON_WRITE = 1160
|
845
|
+
ER_NET_WRITE_INTERRUPTED = 1161
|
846
|
+
ER_TOO_LONG_STRING = 1162
|
847
|
+
ER_TABLE_CANT_HANDLE_BLOB = 1163
|
848
|
+
ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164
|
849
|
+
ER_DELAYED_INSERT_TABLE_LOCKED = 1165
|
850
|
+
ER_WRONG_COLUMN_NAME = 1166
|
851
|
+
ER_WRONG_KEY_COLUMN = 1167
|
852
|
+
ER_WRONG_MRG_TABLE = 1168
|
853
|
+
ER_DUP_UNIQUE = 1169
|
854
|
+
ER_BLOB_KEY_WITHOUT_LENGTH = 1170
|
855
|
+
ER_PRIMARY_CANT_HAVE_NULL = 1171
|
856
|
+
ER_TOO_MANY_ROWS = 1172
|
857
|
+
ER_REQUIRES_PRIMARY_KEY = 1173
|
858
|
+
ER_NO_RAID_COMPILED = 1174
|
859
|
+
ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175
|
860
|
+
ER_KEY_DOES_NOT_EXITS = 1176
|
861
|
+
ER_CHECK_NO_SUCH_TABLE = 1177
|
862
|
+
ER_CHECK_NOT_IMPLEMENTED = 1178
|
863
|
+
ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179
|
864
|
+
ER_ERROR_DURING_COMMIT = 1180
|
865
|
+
ER_ERROR_DURING_ROLLBACK = 1181
|
866
|
+
ER_ERROR_DURING_FLUSH_LOGS = 1182
|
867
|
+
ER_ERROR_DURING_CHECKPOINT = 1183
|
868
|
+
ER_NEW_ABORTING_CONNECTION = 1184
|
869
|
+
ER_DUMP_NOT_IMPLEMENTED = 1185
|
870
|
+
ER_FLUSH_MASTER_BINLOG_CLOSED = 1186
|
871
|
+
ER_INDEX_REBUILD = 1187
|
872
|
+
ER_MASTER = 1188
|
873
|
+
ER_MASTER_NET_READ = 1189
|
874
|
+
ER_MASTER_NET_WRITE = 1190
|
875
|
+
ER_FT_MATCHING_KEY_NOT_FOUND = 1191
|
876
|
+
ER_LOCK_OR_ACTIVE_TRANSACTION = 1192
|
877
|
+
ER_UNKNOWN_SYSTEM_VARIABLE = 1193
|
878
|
+
ER_CRASHED_ON_USAGE = 1194
|
879
|
+
ER_CRASHED_ON_REPAIR = 1195
|
880
|
+
ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196
|
881
|
+
ER_TRANS_CACHE_FULL = 1197
|
882
|
+
ER_SLAVE_MUST_STOP = 1198
|
883
|
+
ER_SLAVE_NOT_RUNNING = 1199
|
884
|
+
ER_BAD_SLAVE = 1200
|
885
|
+
ER_MASTER_INFO = 1201
|
886
|
+
ER_SLAVE_THREAD = 1202
|
887
|
+
ER_TOO_MANY_USER_CONNECTIONS = 1203
|
888
|
+
ER_SET_CONSTANTS_ONLY = 1204
|
889
|
+
ER_LOCK_WAIT_TIMEOUT = 1205
|
890
|
+
ER_LOCK_TABLE_FULL = 1206
|
891
|
+
ER_READ_ONLY_TRANSACTION = 1207
|
892
|
+
ER_DROP_DB_WITH_READ_LOCK = 1208
|
893
|
+
ER_CREATE_DB_WITH_READ_LOCK = 1209
|
894
|
+
ER_WRONG_ARGUMENTS = 1210
|
895
|
+
ER_NO_PERMISSION_TO_CREATE_USER = 1211
|
896
|
+
ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212
|
897
|
+
ER_LOCK_DEADLOCK = 1213
|
898
|
+
ER_TABLE_CANT_HANDLE_FULLTEXT = 1214
|
899
|
+
ER_CANNOT_ADD_FOREIGN = 1215
|
900
|
+
ER_NO_REFERENCED_ROW = 1216
|
901
|
+
ER_ROW_IS_REFERENCED = 1217
|
902
|
+
ER_CONNECT_TO_MASTER = 1218
|
903
|
+
ER_QUERY_ON_MASTER = 1219
|
904
|
+
ER_ERROR_WHEN_EXECUTING_COMMAND = 1220
|
905
|
+
ER_WRONG_USAGE = 1221
|
906
|
+
ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222
|
907
|
+
ER_CANT_UPDATE_WITH_READLOCK = 1223
|
908
|
+
ER_MIXING_NOT_ALLOWED = 1224
|
909
|
+
ER_DUP_ARGUMENT = 1225
|
910
|
+
ER_USER_LIMIT_REACHED = 1226
|
911
|
+
ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227
|
912
|
+
ER_LOCAL_VARIABLE = 1228
|
913
|
+
ER_GLOBAL_VARIABLE = 1229
|
914
|
+
ER_NO_DEFAULT = 1230
|
915
|
+
ER_WRONG_VALUE_FOR_VAR = 1231
|
916
|
+
ER_WRONG_TYPE_FOR_VAR = 1232
|
917
|
+
ER_VAR_CANT_BE_READ = 1233
|
918
|
+
ER_CANT_USE_OPTION_HERE = 1234
|
919
|
+
ER_NOT_SUPPORTED_YET = 1235
|
920
|
+
ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236
|
921
|
+
ER_SLAVE_IGNORED_TABLE = 1237
|
922
|
+
ER_ERROR_MESSAGES = 238
|
923
923
|
|
924
924
|
# Client Error
|
925
|
-
CR_MIN_ERROR
|
926
|
-
CR_MAX_ERROR
|
927
|
-
CR_UNKNOWN_ERROR
|
928
|
-
CR_SOCKET_CREATE_ERROR
|
929
|
-
CR_CONNECTION_ERROR
|
930
|
-
CR_CONN_HOST_ERROR
|
931
|
-
CR_IPSOCK_ERROR
|
932
|
-
CR_UNKNOWN_HOST
|
933
|
-
CR_SERVER_GONE_ERROR
|
934
|
-
CR_VERSION_ERROR
|
935
|
-
CR_OUT_OF_MEMORY
|
936
|
-
CR_WRONG_HOST_INFO
|
937
|
-
CR_LOCALHOST_CONNECTION
|
938
|
-
CR_TCP_CONNECTION
|
939
|
-
CR_SERVER_HANDSHAKE_ERR
|
940
|
-
CR_SERVER_LOST
|
941
|
-
CR_COMMANDS_OUT_OF_SYNC
|
942
|
-
CR_NAMEDPIPE_CONNECTION
|
943
|
-
CR_NAMEDPIPEWAIT_ERROR
|
944
|
-
CR_NAMEDPIPEOPEN_ERROR
|
945
|
-
CR_NAMEDPIPESETSTATE_ERROR
|
946
|
-
CR_CANT_READ_CHARSET
|
947
|
-
CR_NET_PACKET_TOO_LARGE
|
948
|
-
CR_EMBEDDED_CONNECTION
|
949
|
-
CR_PROBE_SLAVE_STATUS
|
950
|
-
CR_PROBE_SLAVE_HOSTS
|
951
|
-
CR_PROBE_SLAVE_CONNECT
|
952
|
-
CR_PROBE_MASTER_CONNECT
|
953
|
-
CR_SSL_CONNECTION_ERROR
|
954
|
-
CR_MALFORMED_PACKET
|
925
|
+
CR_MIN_ERROR = 2000
|
926
|
+
CR_MAX_ERROR = 2999
|
927
|
+
CR_UNKNOWN_ERROR = 2000
|
928
|
+
CR_SOCKET_CREATE_ERROR = 2001
|
929
|
+
CR_CONNECTION_ERROR = 2002
|
930
|
+
CR_CONN_HOST_ERROR = 2003
|
931
|
+
CR_IPSOCK_ERROR = 2004
|
932
|
+
CR_UNKNOWN_HOST = 2005
|
933
|
+
CR_SERVER_GONE_ERROR = 2006
|
934
|
+
CR_VERSION_ERROR = 2007
|
935
|
+
CR_OUT_OF_MEMORY = 2008
|
936
|
+
CR_WRONG_HOST_INFO = 2009
|
937
|
+
CR_LOCALHOST_CONNECTION = 2010
|
938
|
+
CR_TCP_CONNECTION = 2011
|
939
|
+
CR_SERVER_HANDSHAKE_ERR = 2012
|
940
|
+
CR_SERVER_LOST = 2013
|
941
|
+
CR_COMMANDS_OUT_OF_SYNC = 2014
|
942
|
+
CR_NAMEDPIPE_CONNECTION = 2015
|
943
|
+
CR_NAMEDPIPEWAIT_ERROR = 2016
|
944
|
+
CR_NAMEDPIPEOPEN_ERROR = 2017
|
945
|
+
CR_NAMEDPIPESETSTATE_ERROR = 2018
|
946
|
+
CR_CANT_READ_CHARSET = 2019
|
947
|
+
CR_NET_PACKET_TOO_LARGE = 2020
|
948
|
+
CR_EMBEDDED_CONNECTION = 2021
|
949
|
+
CR_PROBE_SLAVE_STATUS = 2022
|
950
|
+
CR_PROBE_SLAVE_HOSTS = 2023
|
951
|
+
CR_PROBE_SLAVE_CONNECT = 2024
|
952
|
+
CR_PROBE_MASTER_CONNECT = 2025
|
953
|
+
CR_SSL_CONNECTION_ERROR = 2026
|
954
|
+
CR_MALFORMED_PACKET = 2027
|
955
955
|
|
956
956
|
CLIENT_ERRORS = [
|
957
957
|
"Unknown MySQL error",
|
@@ -1011,14 +1011,14 @@ class Mysql
|
|
1011
1011
|
len = nil
|
1012
1012
|
@sock.sync = false
|
1013
1013
|
while len == nil or len == MAX_PACKET_LENGTH do
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1014
|
+
a = @sock.read(4)
|
1015
|
+
len = a[0]+a[1]*256+a[2]*256*256
|
1016
|
+
pkt_nr = a[3]
|
1017
|
+
if @pkt_nr != pkt_nr then
|
1018
|
+
raise "Packets out of order: #{@pkt_nr}<>#{pkt_nr}"
|
1019
|
+
end
|
1020
|
+
@pkt_nr = @pkt_nr + 1 & 0xff
|
1021
|
+
buf << @sock.read(len)
|
1022
1022
|
end
|
1023
1023
|
@sock.sync = true
|
1024
1024
|
buf.join
|
@@ -1026,14 +1026,14 @@ class Mysql
|
|
1026
1026
|
|
1027
1027
|
def write(data)
|
1028
1028
|
if data.is_a? Array then
|
1029
|
-
|
1029
|
+
data = data.join
|
1030
1030
|
end
|
1031
1031
|
@sock.sync = false
|
1032
1032
|
ptr = 0
|
1033
1033
|
while data.length >= MAX_PACKET_LENGTH do
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1034
|
+
@sock.write Net::int3str(MAX_PACKET_LENGTH)+@pkt_nr.chr+data[ptr, MAX_PACKET_LENGTH]
|
1035
|
+
@pkt_nr = @pkt_nr + 1 & 0xff
|
1036
|
+
ptr += MAX_PACKET_LENGTH
|
1037
1037
|
end
|
1038
1038
|
@sock.write Net::int3str(data.length-ptr)+@pkt_nr.chr+data[ptr .. -1]
|
1039
1039
|
@pkt_nr = @pkt_nr + 1 & 0xff
|