[ic] Userdb is View of Union - query / scan problems
paul at gishnetwork.com
Tue Dec 7 20:37:31 UTC 2010
> From: peter at pajamian.dhs.org
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] Userdb is View of Union - query / scan problems
> On 08/12/10 08:17, Paul Jordan wrote:
> > IC 5.7.6
> > Mysql 5.0.77
> > I have a userdb that is a Mysql View of a Union. The union ties together
> > TableA and TableB.
> > Using the [Query] and [search-region] I can only retrieve records from
> > this userdb that are from the TableA member of the Union.
> > However, in Admin, I can see all records in userdb (TableA's and
> > tableB's) just fine, and I believe it uses scan to search this.
> > Is there something fundamentally different with [query] that would make
> > it have trouble working on a Union? I don't need to do anything fancy, I
> > really just select a value.
> > No errors in Cat or Vend error.log
> What happens if you run the same queries on the view in the mysql shell?
Hehe, I can see this will take some explanation, although you may wish to just skip to the question at botom.
I have this app that works for two companies owned by the same parent. It's the concensus that eventually the two companies will merge. So I made two apps in two catalogs but using the same database tables for this app. Everything was dandy. Then the owner says he needs it to run *only* on a third domain, for both companies and have no branding.
Knowing that eventually this is all going to run under one company and one catalog (where it alreayd works), this is what I did for this app that runs under a third domain...
Interchange Ecom catalog running for many years, and using dealers
Newer Interchange catalog with no ecom but running some apps. This company will be the company that takes over Company 1.
Third unbranded "APP" Domain:
New IC catalog with a userdb that is a VIEW of dealers in Company1 & Company2 (which I now knows works fine in all cases). This catalogs docroot/<catalog> catroot/pages/<approot> and catroot/templates/regions/<app templates> are all SYMLINK'D the working files in Company 2.
Why I did this:
So I only have to work out of the original Company 2 files to maintain *all* apps and when the companies merge, all I do is turn off the "APP" domain, and everything still works just fine under Company 2. Company 2 after all is where much of this code us being used for other apps - why duplicate when you can symlink right?
What I think is happening....
Since the APP domains templates/regions/FOO is symlinked to company 2 catalog, when the "APP" catalog runs the template, it is actually Company 1's catalog that is processing the template code, and not the APP domain's catalog. I think this because I can take a SELECT * FROM USERDB in the APP domains symilnk'd template and only receive results that are only in Company 2's userdb, but I take that same SELECT and put it in a test page solely inside the APP domain, and it sees everything.
This oinment would not be complete with a fly... if I put a &Log... in the Template, it spits out in the APP domains error log 9as one would expect)
If CatalogA is running a template that is a symlink to a template in CatalogB, what catalog.cfg code will run that template when called from catalogA?
More information about the interchange-users