MySQL Forums
Forum List  »  MySQL Workbench

Re: db.Column.flags doesn't work properly??
Posted by: Johannes Mueller
Date: August 04, 2008 07:31AM

i wrote a small test case plugin for you, so that you can see the problem.

1. Simply open your file editor and save the following LUA code to Workbench\modules\FlagTestCase.grt.lua

2a. open Workbench or reload the plugins with the GRT Shell

2b. create a new table in workbench with a column with a BINARY, UNSIGNED or ZEROFILL flag.

2c. Afterwards you can access the testcase via the Workbench Menu Plugins->Catalog->db.Column.flags: TestCase

3. open the output window and see the results. they should return string, but they return userdata - shouldn't they?

---LUA code---
--
-- db.Column.flags TestCase
function getModuleInfo()
return {
name= "db.Column.flags TestCase",
author= "various",
version= "0.1",
implements= "PluginInterface",
functions= {
"getPluginInfo:l<o@app.Plugin>:",
"runTestCase:i:o@db.Catalog"
}
}
end

function objectPluginInput(type)
return grtV.newObj("app.PluginObjectInput", {objectStructName= type})
end

function getPluginInfo()
local l
local plugin

l= grtV.newList("object", "app.Plugin")

plugin= grtV.newObj("app.Plugin", {
name= "wb.catalog.util.runTestCase",
caption= "db.Column.flags: TestCase",
moduleName= "db.Column.flags TestCase",
pluginType= "normal",
moduleFunctionName= "runTestCase",
inputValues= {objectPluginInput("db.Catalog")},
rating= 100,
showProgress= 0,
groups= {"Catalog/Utilities", "Menu/Catalog"}
})

plugin.inputValues[1].owner= plugin
grtV.insert(l, plugin)

return l
end
--
-- run TestCase
function runTestCase(catalog)
local j,k,l,m
for j=1, grtV.getn(catalog.schemata) do
for k =1, grtV.getn(catalog.schemata[j].tables) do
for l=1, grtV.getn(catalog.schemata[j].tables[k].columns) do
for m=1, grtV.getn(catalog.schemata[j].tables[k].columns[l].flags) do
print(catalog.schemata[j].tables[k].columns[l].flags[m])
print(type(catalog.schemata[j].tables[k].columns[l].flags[m]))
end
end
end
end

Workbench:copyToClipboard(yaml)
print('\n > TestCase done');
return 0
end

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: db.Column.flags doesn't work properly??
3712
August 04, 2008 07:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.