Skip to content

Commit 4d87e05

Browse files
authored
Escaping the error "Method overwriting is not permitted during Module precompilation" with Julia V 1.10 (#217)
* Will it run ? * Next step !
1 parent 7b75f23 commit 4d87e05

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

Diff for: src/api/capi.jl

+8-9
Original file line numberDiff line numberDiff line change
@@ -431,15 +431,14 @@ Zero for success. Nonzero if an error occurred; this occurs for option values th
431431
"""=#
432432
function getoption(mysql::MYSQL, option::mysql_option)
433433
if option in CUINTOPTS
434-
arg = Ref{Cuint}()
434+
return @checksuccess mysql mysql_get_option_Cuint(mysql.ptr, option, Ref{Cuint}())
435435
elseif option in CULONGOPTS
436-
arg = Ref{Culong}()
436+
return @checksuccess mysql mysql_get_option_Culong(mysql.ptr, option, Ref{Culong}())
437437
elseif option in BOOLOPTS
438-
arg = Ref{Bool}()
438+
return @checksuccess mysql mysql_get_option_Bool(mysql.ptr, option, Ref{Bool}())
439439
else
440-
arg = Ref{String}()
440+
return @checksuccess mysql mysql_get_option_String(mysql.ptr, option, Ref{String}())
441441
end
442-
return @checksuccess mysql mysql_get_option(mysql.ptr, option, arg)
443442
end
444443

445444
#="""
@@ -964,18 +963,18 @@ For more information about option files used by MySQL programs, see Section 4.2.
964963
function setoption(mysql::MYSQL, option::mysql_option, arg="0")
965964
if option in CUINTOPTS
966965
ref = Ref{Cuint}(Cuint(arg))
967-
return @checksuccess mysql mysql_options(mysql.ptr, option, ref)
966+
return @checksuccess mysql mysql_options_Cuint(mysql.ptr, option, ref)
968967
elseif option in CULONGOPTS
969968
ref = Ref{Culong}(Culong(arg))
970-
return @checksuccess mysql mysql_options(mysql.ptr, option, ref)
969+
return @checksuccess mysql mysql_options_Culong(mysql.ptr, option, ref)
971970
elseif option in BOOLOPTS
972971
ref = Ref{Bool}(Bool(arg))
973-
return @checksuccess mysql mysql_options(mysql.ptr, option, ref)
972+
return @checksuccess mysql mysql_options_Bool(mysql.ptr, option, ref)
974973
else
975974
str = arg == C_NULL ? C_NULL : String(arg)
976975
GC.@preserve str begin
977976
ref = str == C_NULL ? C_NULL : convert(Ptr{Cvoid}, pointer(str))
978-
return @checksuccess mysql mysql_options(mysql.ptr, option, ref)
977+
return @checksuccess mysql mysql_options_Cvoid(mysql.ptr, option, ref)
979978
end
980979
end
981980
end

Diff for: src/api/ccalls.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -215,28 +215,28 @@ function mysql_get_host_info(mysql::Ptr{Cvoid})
215215
end
216216

217217
#int mysql_get_option(MYSQL *mysql, enum mysql_option option, const void *arg)
218-
function mysql_get_option(mysql::Ptr{Cvoid}, option::Integer, arg::Ref{Cuint})
218+
function mysql_get_option_Cuint(mysql::Ptr{Cvoid}, option::Integer, arg::Ref{Cuint})
219219
return @c(:mysql_get_option,
220220
Cint,
221221
(Ptr{Cvoid}, Cint, Ref{Cuint}),
222222
mysql, option, arg)
223223
end
224224

225-
function mysql_get_option(mysql::Ptr{Cvoid}, option::Integer, arg::Ref{Culong})
225+
function mysql_get_option_Culong(mysql::Ptr{Cvoid}, option::Integer, arg::Ref{Culong})
226226
return @c(:mysql_get_option,
227227
Cint,
228228
(Ptr{Cvoid}, Cint, Ref{Culong}),
229229
mysql, option, arg)
230230
end
231231

232-
function mysql_get_option(mysql::Ptr{Cvoid}, option::Integer, arg::Ref{Bool})
232+
function mysql_get_option_Bool(mysql::Ptr{Cvoid}, option::Integer, arg::Ref{Bool})
233233
return @c(:mysql_get_option,
234234
Cint,
235235
(Ptr{Cvoid}, Cint, Ref{Bool}),
236236
mysql, option, arg)
237237
end
238238

239-
function mysql_get_option(mysql::Ptr{Cvoid}, option::Integer, arg::Ptr{Cvoid})
239+
function mysql_get_option_Cvoid(mysql::Ptr{Cvoid}, option::Integer, arg::Ptr{Cvoid})
240240
return @c(:mysql_get_option,
241241
Cint,
242242
(Ptr{Cvoid}, Cint, Ptr{Cvoid}),
@@ -338,28 +338,28 @@ function mysql_num_rows(results::Ptr{Cvoid})
338338
end
339339

340340
#int mysql_options(MYSQL *mysql, enum mysql_option option, const void *arg)
341-
function mysql_options(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ref{Cuint})
341+
function mysql_options_Cuint(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ref{Cuint})
342342
return @c(:mysql_options,
343343
Cint,
344344
(Ptr{Cvoid}, Cint, Ref{Cuint}),
345345
mysql, option, arg)
346346
end
347347

348-
function mysql_options(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ref{Culong})
348+
function mysql_options_Culong(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ref{Culong})
349349
return @c(:mysql_options,
350350
Cint,
351351
(Ptr{Cvoid}, Cint, Ref{Culong}),
352352
mysql, option, arg)
353353
end
354354

355-
function mysql_options(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ref{Bool})
355+
function mysql_options_Bool(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ref{Bool})
356356
return @c(:mysql_options,
357357
Cint,
358358
(Ptr{Cvoid}, Cint, Ref{Bool}),
359359
mysql, option, arg)
360360
end
361361

362-
function mysql_options(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ptr{Cvoid})
362+
function mysql_options_Cvoid(mysql::Ptr{Cvoid}, option::mysql_option, arg::Ptr{Cvoid})
363363
return @c(:mysql_options,
364364
Cint,
365365
(Ptr{Cvoid}, Cint, Ptr{Cvoid}),

0 commit comments

Comments
 (0)