Questions tagged [debugging]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
43 views

MySQL gives Unknown column error when forward engineering database from diagram

I have a MySQL EER diagram the I forward engineer into a database. I also use the forward engineer feature to generate insert statements for data automatically. After entering about 120 rows of data I ...
SlowlySwift's user avatar
0 votes
1 answer
1k views

Postgres - how to 'print' a variable within a function (similar to python)?

How to print(var) in postgres like python? Given the following code: CREATE OR REPLACE FUNCTION custom_sum(c1 integer, c2 integer) RETURNS integer AS $$ SELECT c1 + c2; $$ LANGUAGE SQL; CREATE ...
baxx's user avatar
  • 276
1 vote
2 answers
1k views

Does Azure Data Studio have a debug Menu or option to debug a stored procedure?

I installed SSMS 19 Preview 4 and it doesn't have a Debug Menu or Debugging option. I also learnt that SSMS V17 was the last version with that capability. Then I decided to try Azure Data Studio, but ...
TmzGOAT's user avatar
  • 21
1 vote
1 answer
148 views

Problem with case statement and dynamic table name

I have the following case statement case %1$s::text when ''lookup_relation_job'' then case %1$s.relation when ''followers'' then ''get-followers'' when ''following'' then ''get-...
Sumit Ghosh's user avatar
0 votes
0 answers
126 views

How to determine the backup source

We are trying to identify what is taking a SQL backup. The physical device name is just a guid which I have seen before when using a VSS type backup but I don't see any backup agent software installed ...
cspell's user avatar
  • 501
0 votes
1 answer
135 views

Debug application performing transaction

I have an application to debug which performs a few dozen operations against a MySQL database. These operations are performed in a single transaction. I need to know the state of the database while ...
dotancohen's user avatar
  • 1,075
0 votes
1 answer
30 views

Second Subquery Inside INSERT Into saves int 0

Read it carefully, we have this query which is inserting values in the table called users. For the value member_id we are running a subquery to select from the table admin_users the id of the member. ...
Meto ballaes's user avatar
0 votes
1 answer
697 views

Identifying processes that open MySQL connections

I need to identify which application process issues a large number of MySQL connections on a Linux system. The show processlist sql command or tools like innotop do not really help, as they only show ...
mvw's user avatar
  • 111
-1 votes
2 answers
74 views

Query all of a sudden stopped working - Simple left join but cannot see what is wrong

I had a query that was a simple left join between two tables with IS NULL included in the where clause because I needed all of the rows of the left table shown, even if it gave null values in the ...
bb25's user avatar
  • 35
3 votes
2 answers
1k views

Display line number where error occurred in DB2 stored procedure

I have added an EXIT handler in my procedure that captures the SQLSTATE and SQLCODE, and even found a way to get the procedure name, but I also need to know where the error occurred. Suggestions ...
Jake v1's user avatar
  • 73
0 votes
1 answer
258 views

How to get syntax and logical ORA in a trace file?

there is an application with tons of queries and one of them cause ORA-1722 To check: I turn trace on session like: alter session set events '10046 trace name context forever, level 12' and say to ...
Mikhail Aksenov's user avatar
2 votes
1 answer
151 views

Is it ok for MySQL to always use 18-25% of Memory (I have 2 GB Ram)?

I have MySQL 8 in my Server with Ram of 2GB. And MySQL is always using 18-25% of Ram even when everything is off. Is it normal? If not then plz let me know how to debug it.
Xinecraft's user avatar
0 votes
2 answers
1k views

How use raise notice in nested and sub-function?

I'm using PgAdmin to create multiple pgsql functions. I'm beginner on this environment. I'm using 'raise notice' to help me for debugging phase. I have two functions with 'raise notice' statement. ...
Stoooff's user avatar
2 votes
1 answer
200 views

Why is an Oracle Package Variable Intermittently Incorrect after Multiple Updates

I am supporting an application that runs on Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production. We have a table that stores hourly data that uses triggers call a package to ...
Vulcronos's user avatar
1 vote
4 answers
135 views

Investigating an Oracle 12c outage after the fact, while limited to SQL*Plus

Warning up front: unfortunately I'm limited to using SQL*Plus on remote site, with no other tools available. This is Oracle 12c (12.2.0.1.0) Standard Edition running on Windows Server 2012R2. Over ...
TrojanName's user avatar
2 votes
0 answers
100 views

How to get the name of a variable instead of its value in plpgsql?

I write a lot of debugging code in plpgsql along the lines: RAISE NOTICE 'var1 = %', var1; (there can be more than one variable to print out). Is it possible to avoid having to repeat the variable ...
tinlyx's user avatar
  • 3,325
1 vote
1 answer
402 views

How to profile the PostgreSQL query planner diagnose what is causing it to take up large amounts of memory and time

I'm fighting with a specific "generated" query (the SQL is generated from a proprietary system, and I won't be able to share it or the execution plan here), and running into simply massive memory ...
Klathmon's user avatar
0 votes
1 answer
45 views

Query stuck in mattermost postgresql communication

Ubuntu 18.04 PostgreSQL 10.10 Mattermost 5.15 On mattermost startup process stay forever on {"level":"info","ts":1570609055.2422519,"caller":"sqlstore/supplier.go:223","msg":"Pinging SQL master ...
Yvain's user avatar
  • 103
0 votes
1 answer
4k views

Finding the cause of a stuck "Sending Data" query in MySQL

I'm running MySQL on a 1gb DigitalOcean droplet, and I have a number of scheduled tasks through the Laravel framework that run. One task in particular (seemingly) randomly causes MySQL to sit at 100% ...
Grayda's user avatar
  • 113
1 vote
2 answers
1k views

IN clause not working on mysql 8.0.17 [closed]

I was on mysql:8.0.15 and I updated to mysql:8.0.17 On 8.0.15 ... and (col1, col2) in (('a', 'b')) the query return results, this is what I expect On 8.0.17 the same query with same data return 0 ...
user3803241's user avatar
0 votes
0 answers
236 views

How to debug INSERT statements

I have issues importing "not-so-small" dumps to MariaDB 10.4.6 in CentOS, but the error log and stderr is empty. I dumped many databases with mysqldump sized around 50MB / 500.000 rows each, and ...
Daniel Grosso's user avatar
1 vote
1 answer
780 views

Duplicate rows with primary key constraint in PostgreSQL 10.6

I have a table that's had CONSTRAINT table_pkey PRIMARY KEY (id) since setup. However, I recently found that I have around 100 duplicate rows (I ran select count(*) from (select count(*) from table ...
mckennab's user avatar
  • 111
0 votes
1 answer
5k views

SQL Server Management Studio - Debugger buttons greyed

I have for mission to enable Transact SQL from a remote computer. My database is on a server and i'm trying to use the debug from a computer on the same network. My firewalls are all open on both side....
Antoine VEYLON's user avatar
1 vote
1 answer
7k views

Mysterious postgres process pegging CPU at 100%; no running queries

I have a recurring issue where a postgres process is pegging my cpu at > 100%. It's a strange one, you can see below the command is ./Ac2p20853 (surrounded by asterisks, added by me). Running SELECT ...
46and2's user avatar
  • 111
3 votes
1 answer
1k views

PostgreSQL: Log statements which do sequential scans

I use this snippet to detect missing indexes: https://stackoverflow.com/a/12818168/633961 Example: SELECT relname AS TableName, to_char(seq_scan, ...
guettli's user avatar
  • 1,421
6 votes
4 answers
11k views

SQL Server Debugger Permissions without Granting sysadmin to Devs

BOL documentation says sysadmin permission is required to run debugger. I'm 90% certain there is no workaround to this requirement, but thought I would ask just in case someone found a way to grant ...
GWR's user avatar
  • 2,767
6 votes
1 answer
3k views

Failed to start TSQL debugger

I want to debug in TSQL.When I start the debug the following message box popup. In SSMS v17.2 Then I see this message: In Microsoft Visual Studio 2015 Server Explorer same Error: Then I see this ...
József Kökény's user avatar
2 votes
0 answers
539 views

Include stored procedure text output in the maintenance plan log

I have a maintenance plan subtask in SQL Server 2012 Enterprise that executes a stored procedure (or a SQL Server agent job). In the log file for this maintenance plan, there are a few lines for this ...
HugoRune's user avatar
  • 361
2 votes
1 answer
613 views

mariadb (mysql) innodb not optimizing SELECT for partitions?

I have a table partitioned by on column "level" -- I have logs where level 7 is the verbose info, which is like 20x as many entries as all the other levels. When purging old logs in level 7, it was ...
user1278519's user avatar
1 vote
1 answer
2k views

Identify mysqldump activity in MySQL log file?

I have a database that is being regularly backed up by mysqldump by... something. It's not a script that I wrote, not sure whose it is. I'm trying to find out more about these dumps, such as what ...
FrustratedWithFormsDesigner's user avatar
1 vote
1 answer
867 views

MongoDB Implicit And

I'm trying to understand mongodb queries, but one of my queries is returning a record that it shouldn't. I am trying to call db.user.find({'referral.money':{'$ne':0, '$ne':null}}) to get all users ...
jakedipity's user avatar
1 vote
0 answers
1k views

Dynamic SQL Stored Procedure called by a Function

I want to be able to dynamically call a function that contains a select statement whose table changes depending on the function parameters. I know this is not possible to do within a function, but I ...
WXMan's user avatar
  • 111
0 votes
1 answer
1k views

MySQL 5.7 GetDiagnostics is always returning null for SQLSTATE What am I doing wrong?

I have the following Handler and the sqlexception is being caught, but GET DIAGNOSTICS is not returning any information - they are all NULL. I have the following code: DECLARE CONTINUE HANDLER FOR ...
StixO's user avatar
  • 167
19 votes
2 answers
22k views

How do I determine why a MongoDB document is failing validation?

How do I determine why a MongoDB document insert is failing validation? All I get back is a writeError that says "Document failed validation", which isn't very helpful. (This happens often, and I'd ...
Jonathan Wheeler's user avatar
0 votes
0 answers
560 views

How to know why my query times out sometimes, but gets executed other times (random behavior)?

I look at my code's logs, and see that a query to delete something which occurs like 200 times a day, sometimes times-out. I have no clue to how to debug this. Because it's a very random behavior. ...
Saeed Neamati's user avatar
1 vote
2 answers
2k views

How to set default schema for PostgreSQL debugger?

I have 3 schemas: public, meta, data. While debugging large function from "data" schema in PgAdmin III or SQL Manager for PostgreSQL, debuggers doesn't see any tables or functions from the same ...
Ice2burn's user avatar
  • 115
1 vote
2 answers
202 views

Get the Text of the currently running SQL?

This is something I am just interested in knowing if it is possible. Could I write an SQL query that could return the text of itself as a variable? Where I might use this would be on things like ...
user802599's user avatar
7 votes
1 answer
9k views

SQL Server: Failed to start debugger - Data is Null

I'm a developer working on a web application using an instance of SQL Server 2014. I use Visual Studio 2010 sp1 for development. For a task I'm currently working on, I'd like to use the SQL Server ...
Garrett Bates's user avatar
1 vote
1 answer
308 views

HSQL DB grows large and is full of zeroes

I have an application whose HSQL database grows awfully large for some users, but not others. When I received one example where this problem happenned, I discovered that the database is nearly empty - ...
JohnEye's user avatar
  • 173
4 votes
2 answers
7k views

Where to look for possible deadlock causes?

We've been having several problems the past days in our production environment, and some of them seem to boil down to database issues. Just realized we are having deadlocks (68 actually), on database ...
Gonzalo Vasquez's user avatar
5 votes
1 answer
415 views

How to change default port for T-SQL Debugger

The default port for T-SQL Debugger is 135, it is possible to change this port ? In my company this port is on special list of banned ports, therefore we need to open that service on another port ...
Muflix's user avatar
  • 1,059
2 votes
0 answers
113 views

SQL Server - Debugging - How to show parametervalues as HEX

I am writing a script which sets Parameters in the Registry for SQL Server. The following works on some of my servers but not all. DECLARE @Parameters AS VARCHAR(MAX) SET @Parameters = '-T1118' ...
Bengelnatz's user avatar
11 votes
1 answer
2k views

Surprising results for data types with type modifier

While discussing a recursive CTE solution for this question: Get the last 5 distinct values for each ID @ypercube stumbled across a surprising exception, which lead us to investigate the handling of ...
Erwin Brandstetter's user avatar
1 vote
2 answers
181 views

Object Reference Not Set ... Debugging Stored Procedure in Visual Studio

I'm working on updating a stored procedure that is called to update a user. This stored procedure needs to also create a description of what was updated for auditing purposes. However when debugging ...
John M.'s user avatar
  • 111
1 vote
0 answers
703 views

SQL server actual execution plan: finding bottlenecks

I have a batch (7 queries) which executes in a couple of seconds locally by takes more than an hour in production. I've have a .sqlplan XML file from that long running query on production and trying ...
axk's user avatar
  • 119
1 vote
2 answers
4k views

SQL Error 1452 : Cannot add or update a child row: a foreign key constraint fails

I am trying to install Zabbix by following this guide. I ran into the following problems when trying to run data.sql after running scheme.sql successfully mysql -D zabbix -uzabbix -pPassword < /...
Computernerd's user avatar
0 votes
0 answers
4k views

mysql eating RAM without queries? [duplicate]

Somehow MySQL eats up 50% of my RAM on the server being used. I checked and there are no queries, show full processlist is empty. I restarted the mysqld and within a couple of minutes the RAM usage ...
Kolja's user avatar
  • 353
3 votes
1 answer
305 views

A workaround for restoring HierarchyId in SQL server 2014

After installing VS 2015 CTP 4, HierarchyID stopped working in SQL Server 2014. This is the bug listed here. I am looking for a workaround. To that end, I have tried reinstalling everything associated ...
soandos's user avatar
  • 157
1 vote
1 answer
478 views

Get the Messages stream in an SSRS RDL Report

So I'm trying to troubleshoot a particular SSRS RDL Report that literally takes forever to run (mostly because it has a mile of SQL to run). My question is: Is there any way to retrieve the execution ...
Tsaukpaetra's user avatar
0 votes
1 answer
48 views

getting null result from table with data [closed]

So i have those two tables: DROP TABLE Ticket CASCADE CONSTRAINTS PURGE; DROP TABLE Store CASCADE CONSTRAINTS PURGE; DROP TABLE Employee CASCADE CONSTRAINTS PURGE; CREATE TABLE Employee ( emp_ID ...
Amture101's user avatar