Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySql AllXml-column is too small #1

Open
atifaziz opened this issue Dec 19, 2017 · 12 comments
Open

MySql AllXml-column is too small #1

atifaziz opened this issue Dec 19, 2017 · 12 comments
Labels

Comments

@atifaziz
Copy link
Member

atifaziz commented Dec 19, 2017

What steps will reproduce the problem?

  1. Get an error on a page with a lot of text in the error message.

What is the expected output? What do you see instead?

The error is logged to the database but is truncated so I can't open it later on when I visit elmah.axd.

What version of the product are you using? On what operating system?

Elmah 1.2, self compiled with a few modifications.

Additional information

The MySql AllXml-column is of type "text" which only handles up to 16kb of text which is enough for most cases but not all. It should be changed to "mediumtext" instead to be sure that the whole error log fits in it.


Originally reported on Google Code with ID 248

Reported by karl.sjogren on 2011-08-19 21:08:38

Copied from original issue: elmah/Elmah#248

@atifaziz
Copy link
Member Author

Reported by @atifaziz on 2011-12-18 16:04:30

  • Labels added: Component-Persistence

@atifaziz
Copy link
Member Author

What type of changes have you made? Does it add more data into the AllXML column? Just curious because I have never seen this problem and typically the 16kb has been enough.

Also do you have the output or a dump of what is currently being stored in one of the columns that has overflowed?

Reported by @nberardi on 2011-12-18 20:58:00

@atifaziz
Copy link
Member Author

My changes were to remove the stored procedures and coding the sql queries directly into the mysql-classes since my host won't let me create stored procedures in the database.

I did a quick query and I have about 18 000 errors logged which are over 17 000 bytes. I've already fixed my database with a "mediumtext" so I don't have any truncated values to show (they were simply cut off so the xml was invalid and crashed elmah.axd) but I've attached three samples that are all too large to fit in a standard "text" column.


Reported by karl.sjogren on 2011-12-18 23:59:42

@atifaziz
Copy link
Member Author

Looks like MVC is creating some quite large stack traces there, so this is probably something that will need fixing!

I would suggest moving to LongText rather than MediumText though. It seems from here: http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html that the storage requirements are virtually the same (1 byte different)!!


Reported by @JamesDriscoll on 2011-12-19 11:23:16

@atifaziz
Copy link
Member Author

Also, I'm intrigued by the hosting policy of not allowing stored procedures. I wonder if this is a common thing, or something that is particular to your host.

Just trying to get a gauge for the extent of the problem. Any thoughts to offer??


Reported by @JamesDriscoll on 2011-12-19 11:26:24

@atifaziz
Copy link
Member Author

I've used 3 different hosts here in Sweden and none of them allowed stored procedures in mysql. One let me create the procedures but not execute them and the rest didn't even allow me to create them (which of course is the reasonable thing since creating without executing is pointless).

If you want I could share my modifications to elmah. I created a new ErrorLogger based on the standard mysql one so it isn't any large changes though.


Reported by karl.sjogren on 2011-12-19 11:48:50

@atifaziz
Copy link
Member Author

Can you ask your host to enable it for you, or is this simply a blanket policy that they enforce regardless?

http://stackoverflow.com/a/1485047

http://stackoverflow.com/questions/6999800/mysql-stored-procedures-on-limited-shared-hosting


Reported by @JamesDriscoll on 2011-12-19 11:56:48

@atifaziz
Copy link
Member Author

My earlier hosts wouldn't allow me to do it but I've never asked the current one. I've sent their support an email asking if it can be enabled. Will get back to you when I get an answer.


Reported by karl.sjogren on 2011-12-19 14:09:41

@atifaziz
Copy link
Member Author

This is probably something we should tackle with the next release.


Reported by @nberardi on 2011-12-19 14:12:48

  • Status changed: Accepted

@atifaziz
Copy link
Member Author

Below is the reply from my current host when I asked about using stored procedures on their servers.

Hello,

Unfortunately this is something that require root access so you won't be able to use stored procedures in our environment.

Sorry if that causes problems.

Now I'm pretty sure that root access isn't required and can be worked around but I'm not taking that discussion with them since we also can see from your samples from SO that this problem also exists elsewhere.


Reported by karl.sjogren on 2011-12-19 19:34:37

@atifaziz
Copy link
Member Author

If you want I could share my modifications to elmah. I created a new ErrorLogger based on the standard mysql one so it isn't any large changes though.

Feel free to contribute this to the ELMAH Sandbox while this issue is being discussed.


Reported by @atifaziz on 2011-12-19 19:54:23

@atifaziz
Copy link
Member Author

This is probably something we should tackle with the next release.

Do you mean the stored proc versus embedded SQL decision or do you mean this issue related to AllXml column being too small?


Reported by @atifaziz on 2011-12-19 19:56:04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant